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); }
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; }