public static T WrapDictionary <T>(this ProxyModule proxyModule, IDictionary <string, string> source) { var pcd = new ProxyClassDescriptor( new DynamicPropertySourceMixin(new DynamicPropertySourceSubject(typeof(T)))); Type proxyType = proxyModule.GetTypeFromProxyClassDescriptor(pcd); return((T)Activator.CreateInstance(proxyType, new object[] { new StringDictionaryDynamicPropertySource(source) })); }
public static T MakePropertyStoreFor <T>(this ProxyModule proxyModule) { var pcd = new ProxyClassDescriptor( new EmptyMixin(new PropertyStoreSubject(typeof(T))), new MethodExistsProxyMetaMixin()); Type proxyType = proxyModule.GetTypeFromProxyClassDescriptor(pcd); return((T)Activator.CreateInstance(proxyType, new object[] {})); }
static FactoryAccessor DefaultRegisterFactory(Action clearAction) { OnDemandProxyModule.AddClearAction(clearAction); return(new FactoryAccessor(ProxyModule.RegisterFactoryType())); }
public SafeFactory(ProxyModule proxyModule) { _proxyModule = proxyModule; }
public static SafeFactory FromProxyModule(ProxyModule proxyModule) { return((SafeFactory)_accessor.GetOrCreateFrom(proxyModule, pm => new SafeFactory(pm))); }
public ProxyModuleCoderAccess(ProxyModule proxyModule) { _proxyModule = proxyModule; }
public DuckFactory(ProxyModule proxyModule) { _proxyModule = proxyModule; }