Exemplo n.º 1
0
        private Property CreatePropertyObject(bool automaticlyExpandObjects, object instance, PropertyDescriptor descriptor, string filter, bool readOnly)
        {
            Property newProp = null;
            //Add a property with Name: AutomaticlyExpandObjects
            Type propertyType = descriptor.PropertyType;

            if (automaticlyExpandObjects && propertyType.IsClass && !propertyType.IsArray && propertyType != typeof(string))
            {
                newProp = new ExpandableProperty(instance, descriptor, automaticlyExpandObjects, filter, readOnly);
            }
            else if (descriptor.Converter.GetType().IsSubclassOf(typeof(ExpandableObjectConverter)))
            {
                newProp = new ExpandableProperty(instance, descriptor, automaticlyExpandObjects, filter, readOnly);
            }
            else
            {
                newProp = new Property(instance, descriptor, readOnly);
            }

            return(newProp);
        }
		private Property CreatePropertyObject(bool automaticlyExpandObjects, object instance, PropertyDescriptor descriptor, string filter, bool readOnly)
		{
			Property newProp = null;
			//Add a property with Name: AutomaticlyExpandObjects
			Type propertyType = descriptor.PropertyType;
			if (automaticlyExpandObjects && propertyType.IsClass && !propertyType.IsArray && propertyType != typeof(string))
			{
				newProp = new ExpandableProperty(instance, descriptor, automaticlyExpandObjects, filter, readOnly);
			}
			else if (descriptor.Converter.GetType().IsSubclassOf(typeof(ExpandableObjectConverter)))
			{
				newProp = new ExpandableProperty(instance, descriptor, automaticlyExpandObjects, filter, readOnly);
			}
			else
				newProp = new Property(instance, descriptor, readOnly);

			return newProp;
		}