コード例 #1
0
        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);
        }
コード例 #2
0
 public static void Bind(object singleton)
 {
     InstanceContainer.Bind(singleton);
 }