예제 #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));
 }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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);
            }
예제 #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);
     }
 }
예제 #6
0
 public CustomChoicesTypeConverter()
 {
     this.oChoices = null;
 }