Inheritance: BaseProxyGenerator
Example #1
0
		public Type CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
		{
			AssertValidType(classToProxy);
			AssertValidTypes(additionalInterfacesToProxy);

			var generator = new ClassProxyGenerator(scope, classToProxy) { Logger = logger };
			return generator.GenerateCode(additionalInterfacesToProxy, options);
		}
		public virtual Type CreateClassProxy(Type theClass, ProxyGenerationOptions options)
		{
			AssertValidType(theClass);

			ClassProxyGenerator generator = new ClassProxyGenerator(scope, theClass);

			return generator.GenerateCode(null, options);
		}
		public Type CreateClassProxy(Type theClass, Type[] interfaces, ProxyGenerationOptions options)
		{
			AssertValidType(theClass);
			AssertValidTypes(interfaces);

			ClassProxyGenerator generator = new ClassProxyGenerator(scope, theClass);

			return generator.GenerateCode(interfaces, options);
		}
Example #4
0
		public object RecreateClassProxy()
		{
			_delegateToBase = _info.GetBoolean ("__delegateToBase");

			ClassProxyGenerator cpGen = new ClassProxyGenerator(_scope, _baseType);

			Type proxy_type = cpGen.GenerateCode(_interfaces, _proxyGenerationOptions);


			if (_delegateToBase)
			{
				return Activator.CreateInstance(proxy_type, new object[] {_info, _context});
			}
			else
			{
				return FormatterServices.GetSafeUninitializedObject(proxy_type);
			}
		}