PageRenderTime 21ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/TestPlugin/MainMenuCommand.cs

http://github.com/icsharpcode/ILSpy
C# | 28 lines | 15 code | 2 blank | 11 comment | 0 complexity | cd3a103b9ac9c4b4aaefaf0b03093bfb MD5 | raw file
 1// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 2// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
 3
 4using ICSharpCode.ILSpy;
 5
 6namespace TestPlugin
 7{
 8	// Menu: menu into which the item is added
 9	// MenuIcon: optional, icon to use for the menu item. Must be embedded as "Resource" (WPF-style resource) in the same assembly as the command type.
10	// Header: text on the menu item
11	// MenuCategory: optional, used for grouping related menu items together. A separator is added between different groups.
12	// MenuOrder: controls the order in which the items appear (items are sorted by this value)
13	[ExportMainMenuCommand(Menu = "_File", MenuIcon = "Clear.png", Header = "_Clear List", MenuCategory = "Open", MenuOrder = 1.5)]
14	// ToolTip: the tool tip
15	// ToolbarIcon: The icon. Must be embedded as "Resource" (WPF-style resource) in the same assembly as the command type.
16	// ToolbarCategory: optional, used for grouping related toolbar items together. A separator is added between different groups.
17	// ToolbarOrder: controls the order in which the items appear (items are sorted by this value)
18	[ExportToolbarCommand(ToolTip = "Clears the current assembly list", ToolbarIcon = "Clear.png", ToolbarCategory = "Open", ToolbarOrder = 1.5)]
19	public class UnloadAllAssembliesCommand : SimpleCommand
20	{
21		public override void Execute(object parameter)
22		{
23			foreach (var loadedAssembly in MainWindow.Instance.CurrentAssemblyList.GetAssemblies()) {
24				loadedAssembly.AssemblyList.Unload(loadedAssembly);
25			}
26		}
27	}
28}