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