internal T Create <T>(object[] partDefinitions, object[] parameters, EventInvokers eventInvokers, IEnumerable <InterceptorMap> wrapperFactories) where T : class { InstanceContainer <T> instanceContainer = new InstanceContainer <T>(partDefinitions, parameters, eventInvokers, wrapperFactories); IInterceptor interceptor = instanceContainer.MasterInterceptor; T target = typeof(T).IsInterface ? generator.CreateInterfaceProxyWithoutTarget <T>(interceptor) : generator.CreateClassProxy <T>(interceptor); instanceContainer.Bind(target); generatedEventInvokers.Add(new WeakReference(target), eventInvokers); return(target); }
public static void Bind(object singleton) { InstanceContainer.Bind(singleton); }