コード例 #1
0
ファイル: Dictionary.cs プロジェクト: Kjubo/xms.core
		internal Dictionary(string name, string caption, bool raiseBitwise, ItemValueDataType valueDataType, string description, DictionaryItemCollection items)
		{
			this.name = name;
			this.caption = caption;
			this.raiseBitwise = raiseBitwise;
			this.itemValueDataType = valueDataType;
			this.description = description;

			this.items = items;

			List<DictionaryItem> list = new List<DictionaryItem>(this.items.Count);

			this.AppendItemsToList(null, this.items, list);

			this.all = new DictionaryItemCollection(list);
		}
コード例 #2
0
ファイル: Dictionary.cs プロジェクト: Kjubo/xms.core
		private void AppendItemsToList(DictionaryItem parent, DictionaryItemCollection items, List<DictionaryItem> list)
		{
			if (items.Count > 0)
			{
				int childLevel = parent == null ? 1 : parent.level + 1;
				if(childLevel>this.levelsCount)
				{
					this.levelsCount = childLevel;
				}

				DictionaryItem child;
				for (int i = 0; i < items.Count; i++)
				{
					child = items[i];
					child.level = childLevel;
					list.Add(child);
					AppendItemsToList(child, child.Children, list);
				}
			}
		}
コード例 #3
0
ファイル: DictionaryItem.cs プロジェクト: Kjubo/xms.core
		internal void SetRelation(DictionaryItem parent, DictionaryItemCollection children)
		{
			this.parent = parent;
			this.children = children;
		}