public static AspNetJsonExecutor Create(JsonFormatter defaultJsonFormatter) { var executor = (AspNetJsonExecutor)TypeHelper.Allocate(typeof(AspNetJsonExecutor)); executor.DefaultJsonFormatter = defaultJsonFormatter; return(executor); }
/// <summary> /// 调用默认构造函数初始化数据源对象。 /// </summary> public void Initialize() { if ((xTypeInfo.flags & XBindingFlags.RWAllocate) != 0) { obj = TypeHelper.Allocate(xTypeInfo.type); } else { obj = Activator.CreateInstance(xTypeInfo.type); } }
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))); }