예제 #1
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);
        }
예제 #2
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;
        }