コード例 #1
0
            public ConditionalPropertyDescripor(PropertyInfo property, ConditionalAttribute attribute)
            {
                this.PropertyInfo = property;
                this.Attribute    = attribute;
                this.Name         = property.Name;
                this.PropertyType = property.PropertyType;

                if (attribute != null && attribute.ConverterType != null)
                {
                    this.Converter = Activator.CreateInstance(attribute.ConverterType) as IConditionalConverter;
                }
            }
コード例 #2
0
            public ConditionalPropertyDescripor(PropertyInfo property, ConditionalAttribute attribute)
            {
                this.Info         = property;
                this.Attribute    = attribute;
                this.Name         = property.Name;
                this.PropertyType = property.PropertyType;

                var defaultAttribute = property.GetCustomAttribute <System.ComponentModel.DefaultValueAttribute>(true);

                if (defaultAttribute != null)
                {
                    this.DefaultValue = Convert.IsDBNull(defaultAttribute.Value) ? null : defaultAttribute.Value;
                }

                if (attribute != null && attribute.ConverterType != null)
                {
                    this.Converter = Activator.CreateInstance(attribute.ConverterType) as IConditionalConverter;
                }
            }
コード例 #3
0
			public ConditionalPropertyDescripor(PropertyInfo property, ConditionalAttribute attribute)
			{
				this.Info = property;
				this.Attribute = attribute;
				this.Name = property.Name;
				this.PropertyType = property.PropertyType;

				var defaultAttribute = property.GetCustomAttribute<System.ComponentModel.DefaultValueAttribute>(true);

				if(defaultAttribute != null)
					this.DefaultValue = Convert.IsDBNull(defaultAttribute.Value) ? null : defaultAttribute.Value;

				if(attribute != null && attribute.ConverterType != null)
					this.Converter = Activator.CreateInstance(attribute.ConverterType) as IConditionalConverter;
			}