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[] {}));
        }
Example #3
0
 static FactoryAccessor DefaultRegisterFactory(Action clearAction)
 {
     OnDemandProxyModule.AddClearAction(clearAction);
     return(new FactoryAccessor(ProxyModule.RegisterFactoryType()));
 }
Example #4
0
 public SafeFactory(ProxyModule proxyModule)
 {
     _proxyModule = proxyModule;
 }
Example #5
0
 public static SafeFactory FromProxyModule(ProxyModule proxyModule)
 {
     return((SafeFactory)_accessor.GetOrCreateFrom(proxyModule, pm => new SafeFactory(pm)));
 }
Example #6
0
 public ProxyModuleCoderAccess(ProxyModule proxyModule)
 {
     _proxyModule = proxyModule;
 }
Example #7
0
 public ProxyModuleCoderAccess(ProxyModule proxyModule)
 {
     _proxyModule = proxyModule;
 }
Example #8
0
 public DuckFactory(ProxyModule proxyModule)
 {
     _proxyModule = proxyModule;
 }