コード例 #1
0
    public static AspNetJsonExecutor Create(JsonFormatter defaultJsonFormatter)
    {
        var executor = (AspNetJsonExecutor)TypeHelper.Allocate(typeof(AspNetJsonExecutor));

        executor.DefaultJsonFormatter = defaultJsonFormatter;

        return(executor);
    }
コード例 #2
0
 /// <summary>
 /// 调用默认构造函数初始化数据源对象。
 /// </summary>
 public void Initialize()
 {
     if ((xTypeInfo.flags & XBindingFlags.RWAllocate) != 0)
     {
         obj = TypeHelper.Allocate(xTypeInfo.type);
     }
     else
     {
         obj = Activator.CreateInstance(xTypeInfo.type);
     }
 }
コード例 #3
0
        public void AllocateTest()
        {
            if (VersionDifferences.UseInternalMethod)
            {
                VersionDifferences.UseInternalMethod = false;

                AllocateTest();

                VersionDifferences.UseInternalMethod = true;
            }


            IsInstanceOf(typeof(Tester), TypeHelper.Allocate(typeof(Tester)));
            IsInstanceOf(typeof(Tester_Struct), TypeHelper.Allocate(typeof(Tester_Struct)));
        }