///<summary>
        ///Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes.
        ///</summary>
        ///
        ///<returns>
        ///A <see cref="T:System.ComponentModel.PropertyDescriptorCollection"></see> with the properties that are exposed for this data type, or null if there are no properties.
        ///</returns>
        ///
        ///<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context. </param>
        ///<param name="attributes">An array of type <see cref="T:System.Attribute"></see> that is used as a filter. </param>
        ///<param name="value">An <see cref="T:System.Object"></see> that specifies the type of array for which to get properties. </param>
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            GenericCollection <T> collection = value as GenericCollection <T>;

            if (collection != null)
            {
                PropertyDescriptor[] properties = new PropertyDescriptor[collection.Count];
                for (int i = 0; i < collection.Count; i++)
                {
                    try
                    {
                        properties[i] = (new PDesc <T>(collection[i]));
                    }
#pragma warning disable EmptyGeneralCatchClause
                    catch (Exception)
#pragma warning restore EmptyGeneralCatchClause
                    {
                    }
                }
                return(new PropertyDescriptorCollection(properties));
            }
            return(base.GetProperties(context, value, attributes));
        }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="index"></param>
 /// <param name="items"></param>
 public void InsertRange(int index, GenericCollection <T> items)
 {
     InnerList.InsertRange(index, items);
 }