-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PluginUIElement for Contacts UI Plugin
- Loading branch information
Showing
8 changed files
with
127 additions
and
94 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Drawing; | ||
using ContactPoint.Common.PluginManager; | ||
using ContactPoint.Core.PluginManager; | ||
using ContactPoint.Plugins.ContactsUi.Forms; | ||
|
||
namespace ContactPoint.Plugins.ContactsUi | ||
{ | ||
internal class ContactsCommand : PluginUIElementBase | ||
{ | ||
private static ContactsListForm _formInstance; | ||
|
||
public ContactsCommand(IPlugin plugin) : base(plugin) | ||
{ } | ||
|
||
public override Guid ActionCode { get; } = new Guid("{F024D728-831F-4F9B-BD13-E156B3CF484A}"); | ||
|
||
public override Bitmap Image => Properties.Resources.contacts1; | ||
public override string Text => "Contacts"; | ||
public override IEnumerable<IPluginUIElement> Childrens => null; | ||
public override bool ShowInMenu => true; | ||
public override bool ShowInToolBar => true; | ||
public override bool ShowInNotifyMenu => true; | ||
|
||
protected override void ExecuteCommand(object sender, object data) | ||
{ | ||
lock (this) | ||
{ | ||
if (_formInstance == null) | ||
{ | ||
_formInstance = new ContactsListForm(Plugin.PluginManager.Core.ContactsManager); | ||
_formInstance.Closing += FormInstanceClosing; | ||
} | ||
|
||
_formInstance.Show(); | ||
} | ||
} | ||
|
||
private void FormInstanceClosing(object sender, System.ComponentModel.CancelEventArgs e) | ||
{ | ||
lock (this) | ||
{ | ||
_formInstance = null; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters