4 using System.Collections.Generic;
7 namespace SiliconStudio.Core.Reflection
9 internal sealed
class ShadowContainer
12 private Dictionary<object, ShadowAttributes> attachedAttributesPerKey;
14 public ShadowContainer()
22 if (attachedAttributesPerKey == null)
23 return EmptyAttributes;
25 return attachedAttributesPerKey.Values;
29 public bool Contains(
object memberKey)
31 if (memberKey == null)
throw new ArgumentNullException(
"memberKey");
32 if (attachedAttributesPerKey == null)
34 return attachedAttributesPerKey.ContainsKey(memberKey);
37 public bool TryGetAttributes(
object memberKey, out ShadowAttributes shadowAttributes)
39 if (memberKey == null)
throw new ArgumentNullException(
"memberKey");
40 shadowAttributes = null;
41 if (attachedAttributesPerKey == null)
44 return attachedAttributesPerKey.TryGetValue(memberKey, out shadowAttributes);
47 public ShadowAttributes GetAttributes(
object memberKey)
49 if (memberKey == null)
throw new ArgumentNullException(
"memberKey");
50 if (attachedAttributesPerKey == null)
51 attachedAttributesPerKey =
new Dictionary<object, ShadowAttributes>();
53 ShadowAttributes shadowAttributes;
54 if (!attachedAttributesPerKey.TryGetValue(memberKey, out shadowAttributes))
56 shadowAttributes =
new ShadowAttributes(
this, memberKey);
57 attachedAttributesPerKey.Add(memberKey, shadowAttributes);
59 return shadowAttributes;
62 public ShadowAttributes
this[
object memberKey]
66 return GetAttributes(memberKey);
One bounding volume completely contains another.