Пример #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>
 public void AddProperty(string name, Type type) {
   PropertySpec widthSpec = new PropertySpec(name, type);
   PropertySpecDescriptor pd = widthSpec.ToPropertyDescriptor();
   pd.OnGetValue += new EventHandler<PropertyEventArgs>(GetValue);
   pd.OnSetValue += new EventHandler<PropertyEventArgs>(SetValue);
   mProperties.Add(pd);
 }
Пример #2
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>
        public void AddProperty(string name, Type type, string category)
        {
            PropertySpec           widthSpec = new PropertySpec(name, type, category);
            PropertySpecDescriptor pd        = widthSpec.ToPropertyDescriptor();

            pd.OnGetValue += new EventHandler <PropertyEventArgs>(GetValue);
            pd.OnSetValue += new EventHandler <PropertyEventArgs>(SetValue);
            mProperties.Add(pd);
        }
Пример #3
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">A Type that represents 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>
        /// <param name="defaultValue">The default value of the property, or null if there is
        /// no default value.</param>
        /// <param name="editor">The Type that represents the type of the editor for this
        /// property.  This type must derive from UITypeEditor.</param>
        /// <param name="typeConverter">The Type that represents the type of the type
        /// converter for this property.  This type must derive from TypeConverter.</param>
        public void AddProperty(string name, Type type, string category, string description, object defaultValue, Type editor, Type typeConverter)
        {
            PropertySpec           widthSpec = new PropertySpec(name, type, category, description, defaultValue, editor, typeConverter);
            PropertySpecDescriptor pd        = widthSpec.ToPropertyDescriptor();

            pd.OnGetValue += new EventHandler <PropertyEventArgs>(GetValue);
            pd.OnSetValue += new EventHandler <PropertyEventArgs>(SetValue);
            mProperties.Add(pd);
        }
 /// <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">A Type that represents 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>
 /// <param name="defaultValue">The default value of the property, or null if there is
 /// no default value.</param>
 /// <param name="editor">The Type that represents the type of the editor for this
 /// property.  This type must derive from UITypeEditor.</param>
 /// <param name="typeConverter">The Type that represents the type of the type
 /// converter for this property.  This type must derive from TypeConverter.</param>
 public void AddProperty(string name, Type type, string category, string description, object defaultValue, Type editor, Type typeConverter)
 {
     PropertySpec widthSpec = new PropertySpec(name, type, category, description, defaultValue, editor, typeConverter);
     PropertySpecDescriptor pd = widthSpec.ToPropertyDescriptor();
     pd.OnGetValue += new EventHandler<PropertyEventArgs>(GetValue);
     pd.OnSetValue += new EventHandler<PropertyEventArgs>(SetValue);
     mProperties.Add(pd);
 }