public PropertyGridProperty(PropertyGridDataProvider dataProvider)
        {
            if (dataProvider == null)
            {
                throw new ArgumentNullException("dataProvider");
            }

            DataProvider   = dataProvider;
            PropertyType   = typeof(object);
            Attributes     = dataProvider.CreateDynamicObject();
            TypeAttributes = dataProvider.CreateDynamicObject();
        }
 public override void OnValueChanged()
 {
     base.OnValueChanged();
     EnumAttributes.Properties.Clear();
     foreach (FieldInfo fi in PropertyType.GetFields(BindingFlags.Static | BindingFlags.Public))
     {
         if (fi.Name.Equals(string.Format("{0}", base.Value)))
         {
             PropertyGridDataProvider.AddDynamicProperties(fi.GetAttributes <PropertyGridAttribute>(), EnumAttributes);
         }
     }
 }
        public virtual PropertyGridProperty GetProperty(string name)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            PropertyGridDataProvider context = GetDataProvider();

            if (context == null)
            {
                return(null);
            }

            return(context.Properties.FirstOrDefault(p => p.Name.EqualsIgnoreCase(name)));
        }
        protected virtual bool CollectionEditorHasOnlyOneColumn(PropertyGridProperty property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            var att = PropertyGridOptionsAttribute.FromProperty(property);

            if (att != null)
            {
                return(att.CollectionEditorHasOnlyOneColumn);
            }

            if (_collectionEditorHasOnlyOneColumnList.Contains(property.CollectionItemPropertyType))
            {
                return(true);
            }

            return(!PropertyGridDataProvider.HasProperties(property.CollectionItemPropertyType));
        }
 public PropertyGridEnumProperty(PropertyGridDataProvider provider)
     : base(provider)
 {
     EnumAttributes = provider.CreateDynamicObject();
 }
 public PropertyGridEnumProperty(PropertyGridDataProvider provider)
     : base(provider)
 {
     EnumAttributes = provider.CreateDynamicObject();
 }