public ActionGroup() { this._data = new ActionsPaneItemCollectionData(); this._items = new ActionsPaneItemCollection(); base.Initialize(this._data, string.Empty, string.Empty, -1, null); this._items.Changed += new ActionsPaneItemCollection.ActionsPaneItemCollectionEventHandler(this.OnItemsChanged); }
public void Write(ActionsPaneItemCollectionData data) { if (data == null) { throw new ArgumentNullException("data"); } int sepCount = 0; int actionCount = 0; int colCount = 0; this.CountItems(data, ref sepCount, ref actionCount, ref colCount); int num4 = (sepCount + actionCount) + colCount; int num5 = actionCount + colCount; this._id = new int[num4]; this._type = new ActionsPaneRootItemType[num4]; this._insertionLocation = new ActionsInsertionLocation[num4]; this._displayName = new string[num5]; this._description = new string[num5]; this._mnemonicDisplayName = new string[num5]; this._languageIndependentName = new string[num5]; this._imageIndex = new int[num5]; this._state = new ActionStates[actionCount]; this._executeSync = new bool[actionCount]; this._renderAsRegion = new bool[colCount]; this._itemsCount = new int[colCount]; int index = 0; int exItemIndex = 0; int actionIndex = 0; int colIndex = 0; this.Write(data, ref index, ref exItemIndex, ref actionIndex, ref colIndex); }
public ActionGroup(string displayName, string description, int imageIndex, object tag) { this._data = new ActionsPaneItemCollectionData(); this._items = new ActionsPaneItemCollection(); if (description == null) { throw Microsoft.ManagementConsole.Internal.Utility.CreateArgumentException("description", Microsoft.ManagementConsole.Internal.Strings.ArgumentExceptionNullValue, new object[0]); } Microsoft.ManagementConsole.Internal.Utility.CheckStringNullOrEmpty(displayName, "displayName", true); base.Initialize(this._data, displayName, description, imageIndex, tag); this._items.Changed += new ActionsPaneItemCollection.ActionsPaneItemCollectionEventHandler(this.OnItemsChanged); }
public ActionsPaneItemCollectionData Read() { int index = 0; int exItemIndex = 0; int actionIndex = 0; int colIndex = 0; ActionsPaneItemData data = null; if (this._id == null) { return null; } if (this._id.Length > 0) { data = this.Read(ref index, ref exItemIndex, ref actionIndex, ref colIndex); } ActionsPaneItemCollectionData data2 = data as ActionsPaneItemCollectionData; if (data2 == null) { data2 = new ActionsPaneItemCollectionData(); if (data != null) { data2.SetItems(new ActionsPaneItemData[] { data }); } } return data2; }
private void ReadCollection(ActionsPaneItemCollectionData data, ref int index, ref int exItemIndex, ref int actionIndex, ref int colIndex) { data.RenderAsRegion = this._renderAsRegion[colIndex]; int num = this._itemsCount[colIndex]; colIndex++; ActionsPaneItemData[] items = new ActionsPaneItemData[num]; for (int i = 0; i < num; i++) { items[i] = this.Read(ref index, ref exItemIndex, ref actionIndex, ref colIndex); } data.SetItems(items); }
private ActionsPaneItemData Read(ref int index, ref int exItemIndex, ref int actionIndex, ref int colIndex) { ActionsPaneItemData data = null; switch (this._type[index]) { case ActionsPaneRootItemType.Separator: data = new ActionSeparatorItemData(); break; case ActionsPaneRootItemType.Action: data = new ActionData(); break; case ActionsPaneRootItemType.Collection: data = new ActionsPaneItemCollectionData(); break; } this.ReadActionsPaneItem(data, ref index); ActionsPaneExtendedItemData data2 = data as ActionsPaneExtendedItemData; if (data2 != null) { this.ReadExtendedActionsPaneItem(data2, ref exItemIndex); ActionData data3 = data2 as ActionData; if (data3 != null) { this.ReadAction(data3, ref actionIndex); return data; } this.ReadCollection((ActionsPaneItemCollectionData) data2, ref index, ref exItemIndex, ref actionIndex, ref colIndex); } return data; }
public ActionsPaneItemCollection() : base(typeof(ActionsPaneItem)) { this._data = new ActionsPaneItemCollectionData(); }
internal void OnSelectionHelpActionsChanged(ActionsPaneItemCollectionData actionsData) { ISnapInPlatform snapInPlatform = this.SnapIn.SnapInPlatform; if (snapInPlatform == null) { throw Microsoft.ManagementConsole.Internal.Utility.CreateClassNotInitializedException("SnapIn", "OnSelectionActionsChanged"); } foreach (ActionsPaneItemData data in actionsData.GetItems()) { data.InsertionLocation = ActionsInsertionLocation.Help; } actionsData.InsertionLocation = ActionsInsertionLocation.Help; UpdateViewActionsCommand command = new UpdateViewActionsCommand(); command.ViewInstanceId = this.ViewInstanceId; command.ActionType = ViewActionType.Help; command.Data = actionsData; snapInPlatform.ProcessCommand(command); }
internal void OnSelectionActionsChanged(ActionsPaneItemCollectionData actionsData) { ISnapInPlatform snapInPlatform = this.SnapIn.SnapInPlatform; if (snapInPlatform == null) { throw Microsoft.ManagementConsole.Internal.Utility.CreateClassNotInitializedException("SnapIn", "OnSelectionActionsChanged"); } UpdateViewActionsCommand command = new UpdateViewActionsCommand(); command.ViewInstanceId = this.ViewInstanceId; command.ActionType = ViewActionType.Selection; command.Data = actionsData; snapInPlatform.ProcessCommand(command); }