public T AddManager <T>()
            where T : BaseManager
        {
            var manager = New <T> .Create();

            ArrayEx.Add(ref m_managers, ref m_managers_size, manager);
            return(manager);
        }
        public static object ConvertFromStore(IStore store, Func <FieldInfo, bool> filter)
        {
            Condition.Requires(store).IsNotNull();

            //validate we're dealing with the right object
            var objectTypeEntry = store.Get <ContextualAsId <string, Type> >(TYPEKEY);

            Condition.Requires(objectTypeEntry).IsNotNull();

            var obj = New.Create(objectTypeEntry.Context);

            HydrateFromStore(store, obj, filter);

            return(obj);
        }
示例#3
0
        private Expression buildExpression()
        {
            if (this.build == null)
            {
                this.build = New.Create(
                    this.localThis,
                    this.allocTypeName,
                    this.allocMemory,
                    this.allocMutability,
                    // __this__.init(args)
                    initCall,
                    // all __this__.member = ...
                    objectInitialization,
                    // --> __this__
                    varReference);
            }

            return(this.build);
        }
示例#4
0
        public void TestNew()
        {
            object obj = New <System.Globalization.RegionInfo> .Create();

            Assert.IsNotNull(obj, "");
            Assert.AreEqual(typeof(System.Globalization.RegionInfo), obj.GetType(), "");

            obj = New <string> .Create();

            Assert.IsNotNull(obj, "");
            Assert.AreEqual(typeof(string), obj.GetType(), "");

            obj = New <Guid> .Create();

            Assert.IsNotNull(obj, "");
            Assert.AreEqual(typeof(Guid), obj.GetType(), "");

            obj = New <Exception> .Create();

            Assert.IsNotNull(obj, "");
            Assert.AreEqual(typeof(Exception), obj.GetType(), "");
        }