mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 05:23:24 -07:00
Introduced a very simple "singleton" service-locator, which allowed for a removal of specific implementations which were very limited. With this it's easier to access dependencies.
This commit is contained in:
parent
3ebdf3d2fe
commit
80d8f51fc5
53 changed files with 744 additions and 1230 deletions
|
@ -45,14 +45,6 @@ namespace GreenshotPlugin.Core {
|
|||
CoreConfig.PropertyChanged += OnIconSizeChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Simple global property to get the Greenshot host
|
||||
/// </summary>
|
||||
public static IGreenshotHost Host {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear icon cache
|
||||
/// </summary>
|
||||
|
@ -220,11 +212,10 @@ namespace GreenshotPlugin.Core {
|
|||
/// <summary>
|
||||
/// Helper method to add a plugin MenuItem to the Greenshot context menu
|
||||
/// </summary>
|
||||
/// <param name="host">IGreenshotHost</param>
|
||||
/// <param name="item">ToolStripMenuItem</param>
|
||||
public static void AddToContextMenu(IGreenshotHost host, ToolStripMenuItem item) {
|
||||
// Here we can hang ourselves to the main context menu!
|
||||
ContextMenuStrip contextMenu = host.MainMenu;
|
||||
public static void AddToContextMenu(ToolStripMenuItem item) {
|
||||
// Here we can hang ourselves to the main context menu!
|
||||
var contextMenu = SimpleServiceProvider.Current.GetInstance<ContextMenuStrip>();
|
||||
bool addedItem = false;
|
||||
|
||||
// Try to find a separator, so we insert ourselves after it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue