Exemplo n.º 1
0
 /// <summary>
 /// Creates the collection which contains the folder items child items.
 /// </summary>
 private void CreateChildItemsCollection()
 {
     _childItems                    = new QSetItemCollection();
     _childItems.OwnerItem          = this;
     _childItems.AfterItemAdded    += new AfterItemAddedEvent(_childItems_AfterItemAdded);
     _childItems.BeforeItemRemoved += new BeforeItemRemovedEvent(_childItems_BeforeItemRemoved);
     _childItems.ItemRepositioned  += new ItemRepositionedEvent(_childItems_ItemRepositioned);
 }
Exemplo n.º 2
0
		/// <summary>
		/// Creates the collection which contains the folder items child items.
		/// </summary>
		private void CreateChildItemsCollection()
		{
			_childItems = new QSetItemCollection();
			_childItems.OwnerItem = this;
			_childItems.AfterItemAdded += new AfterItemAddedEvent(_childItems_AfterItemAdded);
			_childItems.BeforeItemRemoved += new BeforeItemRemovedEvent(_childItems_BeforeItemRemoved);
			_childItems.ItemRepositioned += new ItemRepositionedEvent(_childItems_ItemRepositioned);
		}
Exemplo n.º 3
0
		/// <summary>
		/// Given a requested item name, checks a collection where the new item will be added,
		/// to see if that name already exists.  If it does, a new unique name is generated.
		/// </summary>
		/// <param name="requestedName">Requested name for new folder.</param>
		/// <param name="items">Collection where folder is to be added</param>
		/// <returns>Un</returns>
		public string GetNextAvailableNewItemName(string requestedName, QSetItemCollection items)
		{
			int nextItemNumber = 0;			
			while (items.Exists(requestedName + (nextItemNumber == 0 ? "" : " " + nextItemNumber.ToString())) 
				&& nextItemNumber < int.MaxValue)
			{
				nextItemNumber ++;
			}

			if (items.Exists(requestedName + (nextItemNumber == 0 ? "" : " " + nextItemNumber.ToString())))
				return Guid.NewGuid().ToString();
			else
				return requestedName + (nextItemNumber == 0 ? "" : " " + nextItemNumber.ToString());
		}
Exemplo n.º 4
0
 public Enumerator(QSetItemCollection col)
 {
     _col   = col;
     _index = -1;
 }
Exemplo n.º 5
0
			public Enumerator(QSetItemCollection col)
			{
				_col = col;
				_index = -1;
			}