コード例 #1
0
            public (object bean, InjectionState injectionState) Execute(InjectionState injectionState
                                                                        , BeanFactoryArgs args)
            {
                int x = ((string)null).Length;

                return("", injectionState);
            }
コード例 #2
0
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     object[] @params = (object[])args.FactoryParmeter;
     //Assert(@params.Length == 2);
     //Assert(@params[0] is Type);
     //Assert(@params[1] is String);
     return(GetResourceAsString(@params[0] as Type, @params[1] as String), injectionState);
 }
コード例 #3
0
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     throw new Exception("test exception");
 }
コード例 #4
0
ファイル: SimpleFactory.cs プロジェクト: mikedamay/PureDI
 public (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(injector.CreateAndInjectDependencies <SimpleChild>(injectionState));
 }
コード例 #5
0
ファイル: TypeMismatch.cs プロジェクト: mikedamay/PureDI
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(42, injectionState);
 }
コード例 #6
0
ファイル: DisplayFactory.cs プロジェクト: mikedamay/PureDI
 public (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     if (System.Diagnostics.Debugger.IsAttached)
     {
         return(iocContainer.CreateAndInjectDependencies <VSOutputWindow>(injectionState
                                                                          , rootBeanSpec: new RootBeanSpec(rootBeanName: "outputWindow")));
     }
     else
     {
         return(iocContainer.CreateAndInjectDependencies <ConsoleDisplay>(injectionState));
     }
 }
コード例 #7
0
 public override (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args) => (24, injectionState);
コード例 #8
0
 public (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(new ValueObject((string)args.FactoryParmeter), injectionState);
 }
コード例 #9
0
     Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return (numberProvider.number, injectionState);
 }
コード例 #10
0
 public (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     object[] @params = (object[])args.FactoryParmeter;
     Assert(@params.Length == 2);
     Assert(@params[0] is Type);
     Assert(@params[1] is String);
     return(ConvertResourceToXPathNavigator(@params[0] as Type, @params[1] as String), injectionState);
 }
コード例 #11
0
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(injector.CreateAndInjectDependencies <MemberBean>(injectionState));
 }
コード例 #12
0
ファイル: DiverseCycles.cs プロジェクト: mikedamay/PureDI
        public (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args)
        {
            var pdi = new DependencyInjector();

            if (args.FactoryParmeter as Type == typeof(DiverseA))
            {
                return(pdi.CreateAndInjectDependencies <DiverseA>(injectionState));
            }
            else if (args.FactoryParmeter as Type == typeof(DiverseB))
            {
                return(pdi.CreateAndInjectDependencies(args.FactoryParmeter as Type, injectionState));
            }
            else if (args.FactoryParmeter as Type == typeof(DiverseC))
            {
                return(pdi.CreateAndInjectDependencies((args.FactoryParmeter as Type).FullName, injectionState));
            }
            else
            {
                var diverseD = new DiverseD();
                return(pdi.CreateAndInjectDependencies(diverseD, injectionState));
            }
        }
コード例 #13
0
 public (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(Environment.GetCommandLineArgs().Skip(1).FirstOrDefault(), injectionState);
 }
コード例 #14
0
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(new MyGeneric <int>(), injectionState);
 }
コード例 #15
0
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     throw new System.NotImplementedException();
 }
コード例 #16
0
ファイル: SimpleBean.cs プロジェクト: mikedamay/PureDI
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(args.FactoryParmeter, injectionState);
 }
コード例 #17
0
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(new Level2H(), injectionState);
 }
コード例 #18
0
ファイル: BeanFactoryDemo.cs プロジェクト: mikedamay/PureDI
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(new Repository(Environment.GetEnvironmentVariable("CONNECTION_STRING"))
            , injectionState);
 }
コード例 #19
0
ファイル: ProviderFactory.cs プロジェクト: mikedamay/PureDI
 public (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     if (System.Environment.GetCommandLineArgs().Length > 1)
     {
         return(iocContainer.CreateAndInjectDependencies <FileListProvider>(injectionState));
     }
     else
     {
         return(iocContainer.CreateAndInjectDependencies <UsageListProvider>(injectionState, rootBeanSpec: new RootBeanSpec(rootBeanName: "usage")));
     }
 }
コード例 #20
0
 public abstract (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args);
コード例 #21
0
ファイル: FactoryPrototype.cs プロジェクト: mikedamay/PureDI
 Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     accumulator++;
     return(accumulator, injectionState);
 }
コード例 #22
0
 public (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args)
 {
     return(43, injectionState);
 }
コード例 #23
0
ファイル: ComplexFactory.cs プロジェクト: mikedamay/PureDI
        public (object bean, InjectionState injectionState) Execute(InjectionState injectionState, BeanFactoryArgs args)
        {
            switch ((int)args.FactoryParmeter)
            {
            case 1:
                return(pDependencyInjector.CreateAndInjectDependencies <ChildOne>(injectionState));

            case 2:
                return(pDependencyInjector.CreateAndInjectDependencies <ChildTwo>(injectionState));

            default:
                throw new Exception("Execute failed");
            }
        }