Westwind.Utilities.Expando.GetProperties C# (CSharp) Method

GetProperties() public method

Returns and the properties of
public GetProperties ( bool includeInstanceProperties = false ) : object>>.IEnumerable
includeInstanceProperties bool
return object>>.IEnumerable
        public IEnumerable<KeyValuePair<string, object>> GetProperties(bool includeInstanceProperties = false)
        {
            if (includeInstanceProperties && Instance != null)
            {
                foreach (var prop in this.InstancePropertyInfo)
                    yield return new KeyValuePair<string, object>(prop.Name, prop.GetValue(Instance, null));
            }

            foreach (var key in this.Properties.Keys)
               yield return new KeyValuePair<string, object>(key, this.Properties[key]);
        }