Example #1
0
 private void RefreshChildData()
 {
     ActionsPaneItemData[] items = new ActionsPaneItemData[this.Items.Count];
     for (int i = 0; i < this.Items.Count; i++)
     {
         items[i] = this.Items[i].Data;
     }
     this._data.SetItems(items);
 }
Example #2
0
 private void Write(ActionsPaneItemData data, ref int index, ref int exItemIndex, ref int actionIndex, ref int colIndex)
 {
     this._id[index] = data.Id;
     this._insertionLocation[index] = data.InsertionLocation;
     this._type[index] = ActionsPaneRootItemType.Separator;
     index++;
     ActionsPaneExtendedItemData data2 = data as ActionsPaneExtendedItemData;
     if (data2 != null)
     {
         this._displayName[exItemIndex] = data2.DisplayName;
         this._description[exItemIndex] = data2.Description;
         this._mnemonicDisplayName[exItemIndex] = data2.MnemonicDisplayName;
         this._languageIndependentName[exItemIndex] = data2.LanguageIndependentName;
         this._imageIndex[exItemIndex] = data2.ImageIndex;
         exItemIndex++;
         ActionData data3 = data2 as ActionData;
         if (data3 != null)
         {
             this._state[actionIndex] = data3.State;
             this._executeSync[actionIndex] = data3.ExecuteSync;
             this._type[index - 1] = ActionsPaneRootItemType.Action;
             actionIndex++;
         }
         else
         {
             ActionsPaneItemCollectionData data4 = (ActionsPaneItemCollectionData) data2;
             this._type[index - 1] = ActionsPaneRootItemType.Collection;
             this._renderAsRegion[colIndex] = data4.RenderAsRegion;
             int length = 0;
             ActionsPaneItemData[] items = data4.GetItems();
             if (items != null)
             {
                 length = items.Length;
             }
             this._itemsCount[colIndex] = length;
             colIndex++;
             for (int i = 0; i < length; i++)
             {
                 this.Write(items[i], ref index, ref exItemIndex, ref actionIndex, ref colIndex);
             }
         }
     }
 }
 internal void Initialize(ActionsPaneItemData data, string displayName, string description, int imageIndex, object tag)
 {
     base.Data = data;
     if (!string.IsNullOrEmpty(displayName))
     {
         this.DisplayName = displayName;
     }
     if (!string.IsNullOrEmpty(description))
     {
         this.Description = description;
     }
     if (imageIndex != -1)
     {
         this.ImageIndex = imageIndex;
     }
     if (tag != null)
     {
         base.Tag = tag;
     }
 }
 public void SetItems(ActionsPaneItemData[] items)
 {
     this._items = items;
 }
Example #5
0
 private void CountItems(ActionsPaneItemData data, ref int sepCount, ref int actionCount, ref int colCount)
 {
     ActionsPaneItemCollectionData data2 = data as ActionsPaneItemCollectionData;
     if (data2 != null)
     {
         colCount++;
         ActionsPaneItemData[] items = data2.GetItems();
         if (items != null)
         {
             for (int i = 0; i < items.Length; i++)
             {
                 this.CountItems(items[i], ref sepCount, ref actionCount, ref colCount);
             }
         }
     }
     else if (data is ActionData)
     {
         actionCount++;
     }
     else
     {
         sepCount++;
     }
 }
Example #6
0
 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);
 }
Example #7
0
 private void ReadActionsPaneItem(ActionsPaneItemData data, ref int index)
 {
     data.Id = this._id[index];
     data.InsertionLocation = this._insertionLocation[index];
     index++;
 }
 private void SyncData()
 {
     ActionsPaneItemData[] items = new ActionsPaneItemData[base.Count];
     for (int i = 0; i < base.Count; i++)
     {
         items[i] = this[i].Data;
     }
     this._data.SetItems(items);
 }