GetProperties() public static method

public static GetProperties ( object obj ) : List
obj object
return List
Esempio n. 1
0
        /// <summary>
        /// Delayed loading of the property inspector to avoid creating the entire list of property
        /// editors immediately after selection. Keeps that app running smooth.
        /// </summary>
        /// <param name="performInitialization"></param>
        /// <returns></returns>
        private void ProcessIncrementalPropertyAdd()
        {
            int numberToAdd = 10;

            if (this.propertiesToAdd == null)
            {
                this.propertiesToAdd = PropertyInformation.GetProperties(this.target).GetEnumerator();

                numberToAdd = 0;
            }
            int i = 0;

            for (; i < numberToAdd && this.propertiesToAdd.MoveNext(); ++i)
            {
                // iterate over the PropertyInfo objects,
                // setting the property grid's filter on each object,
                // and adding those properties to the observable collection of propertiesToSort (this.properties)
                PropertyInformation property = this.propertiesToAdd.Current;
                property.Filter = this.Filter;

                if (property.IsVisible)
                {
                    this.properties.Add(property);
                }
                allProperties.Add(property);

                // checking whether a property is visible ... actually runs the property filtering code
                if (property.IsVisible)
                {
                    property.Index = this.visiblePropertyCount++;
                }
            }

            if (i == numberToAdd)
            {
                this.processIncrementalCall.Enqueue();
            }
            else
            {
                this.propertiesToAdd = null;
            }
        }
Esempio n. 2
0
 public static List <PropertyInformation> GetProperties(object obj)
 {
     return(PropertyInformation.GetProperties(obj, new PertinentPropertyFilter(obj).Filter));
 }