예제 #1
0
        /// <summary>
        /// Adds a new property to the property descriptor collection.
        /// </summary>
        /// <param name="name">The name of the property displayed in the property grid.</param>
        /// <param name="type">The fully qualified name of the type of the property.</param>
        /// <param name="category">The category under which the property is displayed in the
        /// property grid.</param>
        /// <param name="description">A string that is displayed in the help area of the
        /// property grid.</param>
        public void AddProperty(string name, Type type, string category, string description)
        {
            PropertySpec           widthSpec = new PropertySpec(name, type, category, description);
            PropertySpecDescriptor pd        = widthSpec.ToPropertyDescriptor();

            pd.OnGetValue += new EventHandler <PropertyEventArgs>(GetValue);
            pd.OnSetValue += new EventHandler <PropertyEventArgs>(SetValue);
            mProperties.Add(pd);
        }