Example #1
0
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     CustomChoices.CustomChoicesAttributeList customChoicesAttributeList = (CustomChoices.CustomChoicesAttributeList)context.PropertyDescriptor.Attributes[typeof(CustomChoices.CustomChoicesAttributeList)];
     if (this.oChoices != null)
     {
         return(this.oChoices.Values);
     }
     return(base.GetStandardValues(context));
 }
Example #2
0
 private void BuildAttributes_CustomChoices()
 {
     if (this.oChoices != null)
     {
         CustomChoices.CustomChoicesAttributeList value = new CustomChoices.CustomChoicesAttributeList(this.oChoices.Items);
         Attribute[] attributes = (Attribute[])new ArrayList
         {
             value
         }.ToArray(typeof(Attribute));
         this.oCustomAttributes = new AttributeCollection(attributes);
     }
 }
Example #3
0
 private void BuildAttributes_CustomChoices()
 {
     if (oChoices != null)
     {
         CustomChoices.CustomChoicesAttributeList list = new CustomChoices.CustomChoicesAttributeList(oChoices.Items);
         ArrayList   attrs = new ArrayList();
         Attribute[] attrArray;
         attrs.Add(list);
         attrArray         = (System.Attribute[])attrs.ToArray(typeof(Attribute));
         oCustomAttributes = new AttributeCollection(attrArray);
     }
 }
Example #4
0
            public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
            {
                CustomChoices.CustomChoicesAttributeList customChoicesAttributeList = (CustomChoices.CustomChoicesAttributeList)context.PropertyDescriptor.Attributes[typeof(CustomChoices.CustomChoicesAttributeList)];
                if (this.oChoices != null)
                {
                    return(true);
                }
                bool result;

                if (customChoicesAttributeList != null)
                {
                    this.oChoices = customChoicesAttributeList;
                    result        = true;
                }
                else
                {
                    result = false;
                }
                return(result);
            }
Example #5
0
 private void BuildAttributes_CustomChoices()
 {
     if (oChoices != null)
     {
         CustomChoices.CustomChoicesAttributeList list = new CustomChoices.CustomChoicesAttributeList(oChoices.Items);
         ArrayList attrs = new ArrayList();
         Attribute[] attrArray;
         attrs.Add(list);
         attrArray =  (System.Attribute[]) attrs.ToArray(typeof(Attribute));
         oCustomAttributes = new AttributeCollection(attrArray);
     }
 }
Example #6
0
 public CustomChoicesTypeConverter()
 {
     this.oChoices = null;
 }