コード例 #1
0
        static PropertyDescriptor[] GetAggregateProperties(ExternalizedMapping property, PropertyDescriptorCollection[] components)
        {
            var propertyType = default(Type);
            var properties   = new PropertyDescriptor[components.Length];

            for (int i = 0; i < properties.Length; i++)
            {
                var descriptor = components[i][property.Name];
                if (descriptor == null)
                {
                    return(EmptyProperties);
                }

                if (propertyType == null)
                {
                    propertyType = descriptor.PropertyType;
                }
                else if (descriptor.PropertyType != propertyType)
                {
                    return(EmptyProperties);
                }

                properties[i] = descriptor;
            }

            return(properties);
        }
コード例 #2
0
 public ExternalizedPropertyDescriptor(ExternalizedMapping property, PropertyDescriptor[] descriptors, object[] components)
     : base(property.ExternalizedName, null)
 {
     instances   = components;
     properties  = descriptors;
     description = property.Description;
     category    = property.Category;
     if (description == string.Empty)
     {
         description = null;
     }
     if (category == string.Empty)
     {
         category = null;
     }
 }
コード例 #3
0
 public ExternalizedMappingPropertyDescriptor(ExternalizedMapping mapping)
     : base(mapping.Name, DescriptorAttributes)
 {
     this.mapping = mapping;
 }