public Attribute this[Type tp] { get { int iIndex; if ((iIndex = mOverrides.IndexOf(tp)) != -1) { return(mOverrides[iIndex].Value); } return(null); } set { int iIndex; if ((iIndex = mOverrides.IndexOf(tp)) != -1) { mOverrides[iIndex] = new DynAttribute(value); } else { mOverrides.Add(value); } } }
/// <summary> /// Removes the overriden attribute specified by attirbuteTypes from all properties. /// </summary> public int RemoveOverridesByType(Type[] attributeTypes) { int iRemoved = 0; foreach (KeyValuePair <string, DynPropertyOverride> dynProp in this) { for (int iType = 0; iType < attributeTypes.Length; iType++) { DynPropertyOverride dynOverride = dynProp.Value; for (int iOverride = 0; iOverride < dynOverride.Overrides.Count; iOverride++) { DynAttribute dynAttribute = dynOverride.Overrides[iOverride]; if (dynAttribute.Equals(attributeTypes[iType])) { dynOverride.Overrides.RemoveAt(iOverride); iOverride--; iRemoved++; } } } } return(iRemoved); }
private static bool IsEqual(DynAttribute dynAttribute1, Type tpAttribute) { return(IsEqual(dynAttribute1.Type, tpAttribute)); }
private static bool IsEqual(DynAttribute dynAttribute1, Attribute sysAttribute) { return(IsEqual(dynAttribute1.Type, sysAttribute.GetType())); }
private static bool IsEqual(DynAttribute dynAttribute1, DynAttribute dynAttribute2) { return(IsEqual(dynAttribute1.Type, dynAttribute2.Type)); }
public int Remove(DynAttribute value) { return(Remove(value.Type)); }
public int IndexOf(DynAttribute value) { return(IndexOf(value.Type)); }
public bool Contains(DynAttribute value) { return(Contains(value.Type)); }