Westwind.Utilities.Expando.Contains C# (CSharp) Méthode

Contains() public méthode

Checks whether a property exists in the Property collection or as a property on the instance
public Contains ( object>.KeyValuePair item, bool includeInstanceProperties = false ) : bool
item object>.KeyValuePair
includeInstanceProperties bool
Résultat bool
        public bool Contains(KeyValuePair<string, object> item, bool includeInstanceProperties = false)
        {
            bool res = Properties.ContainsKey(item.Key);
            if (res)
                return true;

            if (includeInstanceProperties && Instance != null)
            {
                foreach (var prop in this.InstancePropertyInfo)
                {
                    if (prop.Name == item.Key)
                        return true;
                }
            }

            return false;
        }