Example #1
0
 protected override int[] GetItemIndex(object aNode, bool aDeepSearch)
 {
     if (TypeValidator.IsCompatible(aNode.GetType(), typeof(DevelopmentInformationAttribute)) == true)
     {
         int i = (DataSource as DevelopmentDescriptionCollection).IndexOf(aNode);
         if (i == -1)
         {
             return(null);
         }
         return(new int[1] {
             i
         });
     }
     else if (TypeValidator.IsCompatible(aNode.GetType(), typeof(DevelopmentInformationItem)) == true)
     {
         DevelopmentInformationAttribute di = (aNode as DevelopmentInformationItem).Owner;
         int i = (DataSource as DevelopmentDescriptionCollection).IndexOf(di);
         if (i == -1)
         {
             return(null);
         }
         int j = di.IndexOf(aNode as DevelopmentInformationItem);
         if (j == -1)
         {
             return(null);
         }
         return(new int[2] {
             i, j
         });
     }
     return(null);
 }
		/// <summary>
		/// Adds new description to collection
		/// </summary>
		/// <param name="aAttr">
		/// Description <see cref="DevelopmentInformationAttribute"/>
		/// </param>
		private void Add (DevelopmentInformationAttribute aAttr)
		{
			if (aAttr == null)
				return;
			if (descriptions == null)
				descriptions = new List<DevelopmentInformationAttribute>();
			descriptions.Add (aAttr);
		}
		public DevelopmentInformationAttribute[] GetDevelopmentInformations (Type aType)
		{
			ArrayList res = new ArrayList();
			Attribute[] attrs = (Attribute[]) aType.GetCustomAttributes (false);
			foreach (Attribute attr in attrs)
				if (TypeValidator.IsCompatible(attr.GetType(), typeof(DevelopmentInformationAttribute)) == true)
					res.Add (attr);
			DevelopmentInformationAttribute[] arr = new DevelopmentInformationAttribute[res.Count];
			for (int i=0; i<Count; i++)
				arr[i] = (DevelopmentInformationAttribute) res[i];
			res.Clear();
			res = null;
			return (arr);
		}