Beispiel #1
0
		private static Int64 CalcualteBitwiseValue(DictionaryDataItemCollection dataItems)
		{
			Int64 value = 0;
			if (dataItems.Count > 0)
			{
				DictionaryDataItem child;
				for (int i = 0; i < dataItems.Count; i++)
				{
					child = dataItems[i];
					if (child.Children.Count == 0)
					{
						if (child.Selected)
						{
							value = value | child.DictionaryItem.Value; // 对选中的值进行位运算
						}
					}
					else
					{
						value = value | CalcualteBitwiseValue(child.Children);
					}
				}
			}
			return value;
		}
Beispiel #2
0
		internal DictionaryData(Dictionary dictionary)
		{
			this.dictionary = dictionary;

			this.dataItems = new DictionaryDataItemCollection(this, null, this.dictionary.Items);
		}
Beispiel #3
0
		private void AppendItemsToList(DictionaryDataItem parent, DictionaryDataItemCollection dataItems, List<DictionaryDataItem> list)
		{
			if (dataItems.Count > 0)
			{
				DictionaryDataItem child;
				for (int i = 0; i < dataItems.Count; i++)
				{
					child = dataItems[i];
					list.Add(child);
					if (child.Children.Count>0)
					{
						AppendItemsToList(child, child.Children, list);
					}
				}
			}
		}
Beispiel #4
0
		internal void SetRelation(DictionaryData owner, DictionaryDataItem parent, DictionaryDataItemCollection children)
		{
			this.owner = owner;
			this.parent = parent;
			this.children = children;
		}