You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.7 KiB

14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
  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. using System.Composition;
  4. using ICSharpCode.ILSpy;
  5. using ICSharpCode.ILSpy.AssemblyTree;
  6. namespace 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(ParentMenuID = "_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. [Shared]
  20. public class UnloadAllAssembliesCommand(AssemblyTreeModel assemblyTreeModel) : SimpleCommand
  21. {
  22. public override void Execute(object parameter)
  23. {
  24. foreach (var loadedAssembly in assemblyTreeModel.AssemblyList.GetAssemblies())
  25. {
  26. loadedAssembly.AssemblyList.Unload(loadedAssembly);
  27. }
  28. }
  29. }
  30. }