Esempio n. 1
0
        public ShadowAttributes Clone()
        {
            // Shallow clone, assuming that attributes values are vauetypes.
            var newShadowAttributes = new ShadowAttributes(Container, Key);

            Attributes.CopyTo(ref newShadowAttributes.Attributes);
            return(newShadowAttributes);
        }
Esempio n. 2
0
        public bool TryGetAttributes(object memberKey, out ShadowAttributes shadowAttributes)
        {
            if (memberKey == null)
            {
                throw new ArgumentNullException("memberKey");
            }
            shadowAttributes = null;
            if (attachedAttributesPerKey == null)
            {
                return(false);
            }

            return(attachedAttributesPerKey.TryGetValue(memberKey, out shadowAttributes));
        }
Esempio n. 3
0
        public ShadowAttributes GetAttributes(object memberKey)
        {
            if (memberKey == null)
            {
                throw new ArgumentNullException("memberKey");
            }
            if (attachedAttributesPerKey == null)
            {
                attachedAttributesPerKey = new Dictionary <object, ShadowAttributes>();
            }

            ShadowAttributes shadowAttributes;

            if (!attachedAttributesPerKey.TryGetValue(memberKey, out shadowAttributes))
            {
                shadowAttributes = new ShadowAttributes(this, memberKey);
                attachedAttributesPerKey.Add(memberKey, shadowAttributes);
            }
            return(shadowAttributes);
        }