public PropertyWrapper(T value) { if (!PropertyBagStore.Exists <PropertyWrapper <T> >()) { PropertyBagStore.AddPropertyBag(new PropertyBag()); } Value = value; }
/// <summary> /// Creates and registers a <see cref="IPropertyBag{T}"/> for a <see cref="Dictionary{TKey, TValue}"/> type. /// </summary> /// <remarks> /// The container is required to provide AOT code paths for <see cref="PropertyVisitor"/>. /// </remarks> /// <typeparam name="TContainer">The container type to register.</typeparam> /// <typeparam name="TKey">The key type to register.</typeparam> /// <typeparam name="TValue">The value type to register.</typeparam> public static void RegisterDictionary <TContainer, TKey, TValue>() { AOT.DictionaryPropertyGenerator <TContainer, Dictionary <TKey, TValue>, TKey, TValue> .Preserve(); if (PropertyBagStore.TypedStore <IPropertyBag <Dictionary <TKey, TValue> > > .PropertyBag == null) { PropertyBagStore.AddPropertyBag(new DictionaryPropertyBag <TKey, TValue>()); } }
/// <summary> /// Creates and registers a <see cref="IPropertyBag{T}"/> for a <see cref="HashSet{TElement}"/> type. /// </summary> /// <remarks> /// The container is required to provide AOT code paths for <see cref="PropertyVisitor"/>. /// </remarks> /// <typeparam name="TContainer">The container type to register.</typeparam> /// <typeparam name="TElement">The element type to register.</typeparam> public static void RegisterHashSet <TContainer, TElement>() { AOT.SetPropertyGenerator <TContainer, HashSet <TElement>, TElement> .Preserve(); if (PropertyBagStore.TypedStore <IPropertyBag <HashSet <TElement> > > .PropertyBag == null) { PropertyBagStore.AddPropertyBag(new HashSetPropertyBag <TElement>()); } }
/// <summary> /// Creates and registers a <see cref="IPropertyBag{T}"/> for a built in array type. /// </summary> /// <remarks> /// The container is required to provide AOT code paths for <see cref="PropertyVisitor"/>. /// </remarks> /// <typeparam name="TContainer">The container type to register.</typeparam> /// <typeparam name="TElement">The element type to register.</typeparam> public static void RegisterArray <TContainer, TElement>() { AOT.ListPropertyGenerator <TContainer, TElement[], TElement> .Preserve(); if (PropertyBagStore.TypedStore <IPropertyBag <TElement[]> > .PropertyBag == null) { PropertyBagStore.AddPropertyBag(new ArrayPropertyBag <TElement>()); } }
/// <summary> /// Registers an internal list property bag for the given types. /// </summary> /// <typeparam name="TContainer">The container type to register.</typeparam> /// <typeparam name="TSet">The generic set type to register.</typeparam> /// <typeparam name="TElement">The element type to register.</typeparam> public static void RegisterSet <TContainer, TSet, TElement>() where TSet : ISet <TElement> { AOT.SetPropertyGenerator <TContainer, TSet, TElement> .Preserve(); if (PropertyBagStore.TypedStore <IPropertyBag <TSet> > .PropertyBag == null) { PropertyBagStore.AddPropertyBag(new SetPropertyBag <TSet, TElement>()); } }
/// <summary> /// Registers an internal list property bag for the given types. /// </summary> /// <typeparam name="TContainer">The container type to register.</typeparam> /// <typeparam name="TList">The generic list type to register.</typeparam> /// <typeparam name="TElement">The element type to register.</typeparam> public static void RegisterList <TContainer, TList, TElement>() where TList : IList <TElement> { AOT.ListPropertyGenerator <TContainer, TList, TElement> .Preserve(); if (PropertyBagStore.TypedStore <IPropertyBag <TList> > .PropertyBag == null) { PropertyBagStore.AddPropertyBag(new ListPropertyBag <TList, TElement>()); } }
static void Initialize() { PropertyBagStore.AddPropertyBag(new AnimationCurvePropertyBag()); PropertyBagStore.AddPropertyBag(new KeyFramePropertyBag()); PropertyBagStore.AddPropertyBag(new Vector2IntPropertyBag()); PropertyBagStore.AddPropertyBag(new Vector3IntPropertyBag()); PropertyBagStore.AddPropertyBag(new RectPropertyBag()); PropertyBagStore.AddPropertyBag(new RectIntPropertyBag()); PropertyBagStore.AddPropertyBag(new BoundsPropertyBag()); PropertyBagStore.AddPropertyBag(new BoundsIntPropertyBag()); }
/// <summary> /// Registers an internal dictionary property bag for the given types. /// </summary> /// <typeparam name="TContainer">The container type to register.</typeparam> /// <typeparam name="TDictionary">The generic dictionary type to register.</typeparam> /// <typeparam name="TKey">The key type to register.</typeparam> /// <typeparam name="TValue">The value type to register.</typeparam> public static void RegisterDictionary <TContainer, TDictionary, TKey, TValue>() where TDictionary : IDictionary <TKey, TValue> { AOT.DictionaryPropertyGenerator <TContainer, TDictionary, TKey, TValue> .Preserve(); if (PropertyBagStore.TypedStore <IPropertyBag <TDictionary> > .PropertyBag == null) { PropertyBagStore.AddPropertyBag(new DictionaryPropertyBag <TDictionary, TKey, TValue>()); PropertyBagStore.AddPropertyBag(new KeyValuePairPropertyBag <TKey, TValue>()); } }
static void Initialize() { PropertyBagStore.AddPropertyBag(new AnimationCurvePropertyBag()); PropertyBagStore.AddPropertyBag(new KeyFramePropertyBag()); }
static EntityContainer() { PropertyBagStore.AddPropertyBag(new EntityContainerPropertyBag()); }
/// <summary> /// Registers a strongly typed <see cref="ContainerPropertyBag{TContainer}"/> for a type. /// </summary> /// <param name="propertyBag">The <see cref="ContainerPropertyBag{TContainer}"/> to register.</param> /// <typeparam name="TContainer">The container type this property bag describes.</typeparam> public static void Register <TContainer>(ContainerPropertyBag <TContainer> propertyBag) { PropertyBagStore.AddPropertyBag(propertyBag); }
static JsonArray() { PropertyBagStore.AddPropertyBag(new IndexedCollectionPropertyBag <JsonArray, object>()); }
static JsonObject() { PropertyBagStore.AddPropertyBag(new KeyValueCollectionPropertyBag <JsonObject, string, object>()); }
static JsonArray() { PropertyBagStore.AddPropertyBag(new ListPropertyBag <JsonArray, object>()); }
static JsonObject() { PropertyBagStore.AddPropertyBag(new DictionaryPropertyBag <JsonObject, string, object>()); }