Beispiel #1
0
        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);
                }
            }
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
 private static bool IsEqual(DynAttribute dynAttribute1, Type tpAttribute)
 {
     return(IsEqual(dynAttribute1.Type, tpAttribute));
 }
Beispiel #4
0
 private static bool IsEqual(DynAttribute dynAttribute1, Attribute sysAttribute)
 {
     return(IsEqual(dynAttribute1.Type, sysAttribute.GetType()));
 }
Beispiel #5
0
 private static bool IsEqual(DynAttribute dynAttribute1, DynAttribute dynAttribute2)
 {
     return(IsEqual(dynAttribute1.Type, dynAttribute2.Type));
 }
Beispiel #6
0
 public int Remove(DynAttribute value)
 {
     return(Remove(value.Type));
 }
Beispiel #7
0
 public int IndexOf(DynAttribute value)
 {
     return(IndexOf(value.Type));
 }
Beispiel #8
0
 public bool Contains(DynAttribute value)
 {
     return(Contains(value.Type));
 }