public PropertyWrapper(T value)
        {
            if (!PropertyBagStore.Exists <PropertyWrapper <T> >())
            {
                PropertyBagStore.AddPropertyBag(new PropertyBag());
            }

            Value = value;
        }
Beispiel #2
0
        /// <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>());
            }
        }
Beispiel #3
0
        /// <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>());
            }
        }
Beispiel #4
0
        /// <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>());
            }
        }
Beispiel #5
0
        /// <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>());
            }
        }
Beispiel #6
0
        /// <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>());
            }
        }
Beispiel #7
0
 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());
 }
Beispiel #8
0
        /// <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>());
            }
        }
Beispiel #9
0
 static void Initialize()
 {
     PropertyBagStore.AddPropertyBag(new AnimationCurvePropertyBag());
     PropertyBagStore.AddPropertyBag(new KeyFramePropertyBag());
 }
Beispiel #10
0
 static EntityContainer()
 {
     PropertyBagStore.AddPropertyBag(new EntityContainerPropertyBag());
 }
Beispiel #11
0
 /// <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);
 }
Beispiel #12
0
 static JsonArray()
 {
     PropertyBagStore.AddPropertyBag(new IndexedCollectionPropertyBag <JsonArray, object>());
 }
Beispiel #13
0
 static JsonObject()
 {
     PropertyBagStore.AddPropertyBag(new KeyValueCollectionPropertyBag <JsonObject, string, object>());
 }
Beispiel #14
0
 static JsonArray()
 {
     PropertyBagStore.AddPropertyBag(new ListPropertyBag <JsonArray, object>());
 }
Beispiel #15
0
 static JsonObject()
 {
     PropertyBagStore.AddPropertyBag(new DictionaryPropertyBag <JsonObject, string, object>());
 }