/// <summary> /// Called by the base class in part of the build out /// this method adds the Tasks option to the right-hand pane in the SCOM console. /// </summary> protected override void AddActions() { // Add the Catalog Custom tasks to the Right-hand tasks pane. AddTaskItem(TaskCommands.ActionsTaskGroup, ManagementPackCatalogCommands.ViewURL, new EventHandler <CommandEventArgs>(ShowManagementPackSourceURL)); AddTaskSeparatorItem("Catalog Actions", TaskCommands.ActionsTaskGroup); // Activity related to the Properties Task on the Right-hand side of the console AddTaskItem(TaskCommands.ActionsTaskGroup, ViewCommands.Properties); CommandID properties = ViewCommands.Properties; InstalledCatalogPacks installedCatalogPacks1 = this; InstalledCatalogPacks installedCatalogPacks2 = this; CommandHelpers.RegisterForNotification(properties, new EventHandler <CommandEventArgs>(installedCatalogPacks1.OnPropertiesCommand), new EventHandler <CommandStatusEventArgs>(installedCatalogPacks2.UpdatePropertiesCommandStatus)); // Activity related to the Delete Task on the Right-hand side of the console AddTaskItem(TaskCommands.ActionsTaskGroup, MomViewCommands.DeleteSelectedViewItem); CommandHelpers.RegisterForNotification(StandardCommands.Delete, new EventHandler <CommandEventArgs>(OnDelete), new EventHandler <CommandStatusEventArgs>(OnStatusDelete)); CommandHelpers.RegisterForNotification(MomViewCommands.DeleteSelectedViewItem, new EventHandler <CommandEventArgs>(OnDelete), new EventHandler <CommandStatusEventArgs>(OnStatusDelete)); // This help isn't specific to the community packs. HelpKey = "Management Packs"; base.AddActions(); Log.WriteTrace( EventType.UIActivity, "Added Task Actions to the base instance."); }
/// <summary> /// Configures and adds items to the Right-Click contextual menu. /// </summary> /// <param name="contextMenu">menu to work with</param> /// <param name="data">GridView Data</param> protected override void AddRowContextMenu(ContextMenuHelper contextMenu, GitHubPackDetail data) { // Catalog Contextual Right-Click for the Catalog contextMenu.AddContextMenuItem(ManagementPackCatalogCommands.ViewURL, new EventHandler <CommandEventArgs>(ShowManagementPackSourceURL)); // Contextual Right-Click Properties CommandID properties = ViewCommands.Properties; InstalledCatalogPacks installedCatalogPacks1 = this; InstalledCatalogPacks installedCatalogPacks2 = this; contextMenu.AddContextMenuSeparator(); contextMenu.AddContextMenuItem(properties, new EventHandler <CommandEventArgs>(installedCatalogPacks1.OnPropertiesCommand), new EventHandler <CommandStatusEventArgs>(installedCatalogPacks2.UpdatePropertiesCommandStatus)); // Contextual Right-Click Delete contextMenu.AddContextMenuSeparator(); contextMenu.AddContextMenuItem(StandardCommands.Delete, new EventHandler <CommandEventArgs>(OnDelete), new EventHandler <CommandStatusEventArgs>(OnStatusDelete)); Log.WriteTrace( EventType.UIActivity, "Context Menu items added to the base GridView."); }