public NinjectDependencyResolver(params Ninject.Modules.INinjectModule[] models)
 {
     m_Kernel = new Ninject.StandardKernel(new Ninject.NinjectSettings()
     {
         DefaultScopeCallback = ctx => System.Web.HttpContext.Current
     }, models);
 }
Esempio n. 2
0
 public NinjectDependencyResolver(params Ninject.Modules.INinjectModule[] models)
 {
     m_Kernel = new Ninject.StandardKernel(new Ninject.NinjectSettings()
     {
         DefaultScopeCallback = ctx => System.Web.HttpContext.Current
     }, models);
 }
 public static IKernel CreateFromKernel(n.IKernel baseKernel)
 {
     if (baseKernel.GetBindings(typeof(my.IKernel)).Any())
     {
         throw new DependencyException("Make sure that the given kernel doesn't bind to IKernel, because this bind is used internally");
     }
     return(new Yaaf.DependencyInjection.Ninject.NinjectKernel(baseKernel));
 }
 internal NinjectKernel(n.IKernel kernel)
 {
     this.kernel = kernel;
     try {
         this.kernel.Bind <my.IKernel> ().ToConstant(this);
     } catch (ActivationException err) {
         throw WrapExn(err);
     }
 }
 public NinjectControllerFactory()
 {
     _kernel = new Ninject.StandardKernel();
     _kernel.Bind <INavigationProvider>().To <NavigationProvider>();
     _kernel.Bind <IEkDataProvider>().To <EkDataProvider>();
     _kernel.Bind <IEkSiteDataProvider>().To <EkSiteDataProvider>();
     _kernel.Bind <IImageDataProvider>().To <ImageProvider>();
     _kernel.Bind <IEKProvider>().To <EKProvider>();
 }
 public NinjectControllerFactory()
 {
     _kernel = new Ninject.StandardKernel();
     _kernel.Bind<INavigationProvider>().To<NavigationProvider>();
     _kernel.Bind<IEkDataProvider>().To<EkDataProvider>();
     _kernel.Bind<IEkSiteDataProvider>().To<EkSiteDataProvider>();
     _kernel.Bind<IImageDataProvider>().To<ImageProvider>();
     _kernel.Bind<IEKProvider>().To<EKProvider>();
 }
Esempio n. 7
0
        public LotServer(LotServerConfiguration config, Ninject.IKernel kernel) : base(config, kernel)
        {
            this.Config = config;

            Kernel.Bind <LotServerConfiguration>().ToConstant(Config);
            Kernel.Bind <LotHost>().To <LotHost>().InSingletonScope();
            Kernel.Bind <CityConnections>().To <CityConnections>().InSingletonScope();
            Kernel.Bind <LotServer>().ToConstant(this);

            LotLivenessTimer.AutoReset = true;
            LotLivenessTimer.Elapsed  += LivenessCheck;

            Lots = Kernel.Get <LotHost>();
        }
Esempio n. 8
0
        public LotServer(LotServerConfiguration config, Ninject.IKernel kernel) : base(config, kernel)
        {
            this.Config = config;
            this.UnexpectedDisconnectWaitSeconds = 30;
            this.TimeoutIfNoAuth = config.Timeout_No_Auth;

            Kernel.Bind <LotServerConfiguration>().ToConstant(Config);
            Kernel.Bind <LotHost>().To <LotHost>().InSingletonScope();
            Kernel.Bind <CityConnections>().To <CityConnections>().InSingletonScope();
            Kernel.Bind <LotServer>().ToConstant(this);

            LotLivenessTimer.AutoReset = true;
            LotLivenessTimer.Elapsed  += LivenessCheck;

            Lots = Kernel.Get <LotHost>();
        }
 public TodoCRUDManagerTests(bool isIntegration = false)
 {
     // this constructor allows for integration test reuse
     if (isIntegration)
     {
         // Implicit self binding allows us to get a concrete class with fulfilled dependencies
         // https://github.com/ninject/ninject/wiki/dependency-injection-with-ninject
         Ninject.IKernel kernel = DependencyInjectionLoader.BuildKernel();
         manager  = kernel.Get <TodoCRUDManager>();
         dataPrep = new TodoDataPrep(true);
     }
     else
     {
         manager = mockContainer.Instance;
         // dataPrep non-persistant by default in base class
     }
 }
 public NInjectDependencyResolver()
 {
     this.kernel = new StandardKernel();
     //kernel.Bind<IUnitOfWork>().To<UnitOfWork>();
     BindDependencies();
 }
 public NInjectDependencyResolver(Ninject.IKernel kernel)
 {
     this.kernel = kernel;
 }
Esempio n. 12
0
 public NinjectResolver(Ninject.IKernel kernel) : base(kernel)
 {
     // TODO: Complete member initialization
     this._kernel = kernel;
 }
 public ExpressionBuilderWindowFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
 public DiFixtureNinject(params INinjectModule[] modules)
 {
     Kernel = new StandardKernel();
     Kernel.Load(modules);
 }
Esempio n. 15
0
 public FileFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
 public NinjectDependencyResolver(IKernel kernel) : base(kernel)
 {
     this.kernel = kernel;
 }
 /// <summary>
 /// 构造函数
 /// </summary>
 public NinjectDependencyResolver()
 {
     this.kernel = new Ninject.StandardKernel();
     this.kernel.Settings.InjectNonPublic = true;
     this.AddBindings();
 }
Esempio n. 18
0
 public NInjectDependencyResolver(Ninject.IKernel kernel)
 {
     this.kernel = kernel;
 }
 public NinjectControllerFactory()
 {
     ninjectKernel = new Ninject.StandardKernel();
     AddBindings();
 }
Esempio n. 20
0
 public NInjectDependencyResolver()
 {
     this.kernel= new StandardKernel();
      kernel.Bind<IUnitOfWork>().To<EFUnitOfWork>();
      BindDependencies();
 }
 public SaveExpressionMessageWindowFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
Esempio n. 22
0
 public NinjectDependencyResolver(Action <IKernel> addBindings)
 {
     this.kernel = SiteManager.Kernel;
     addBindings(kernel);
 }
Esempio n. 23
0
 public static void BootStrap()
 {
     NinjectContainer = new StandardKernel();
     AddIoCBindings();
     Grit.RBAC.Configuration.BootStrapper.BootStrap(NinjectContainer);
 }
 public ExpressionBuilderWindowFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
 public NinjectDependencyResolver(IKernel kernel)
     : base(kernel)
 {
     this.kernel = kernel;
 }
 public DiFixtureNinject(IConfigurationRoot configuration, params INinjectModule[] modules) : base(configuration)
 {
     Kernel = new StandardKernel();
     Kernel.Load(modules);
 }
Esempio n. 27
0
 public TabItemFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
 public SaveExpressionMessageWindowFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
 public DiFixtureNinject()
 {
     Kernel = new StandardKernel();
 }
Esempio n. 30
0
 public TabItemFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
 /// <summary>
 /// Constructor that takes an IConfiguration parameter
 /// </summary>
 /// <param name="configuration"></param>
 public DiFixtureNinject(IConfigurationRoot configuration) : base(configuration)
 {
     Kernel = new StandardKernel();
 }
Esempio n. 32
0
        protected override void OnStartup(StartupEventArgs e)
        {
            Kernel = new StandardKernel();

            // Split the kernel loading into seperate modules that contain logically related content
            // There is some overlapping dependencies at the moment that I'd like to refactor.
            // And should you Ninject your Ninject modules?
            Kernel.Load(new INinjectModule[] { new MasterModule(this) });

            MainWindow mainWindow = Kernel.Get<MainWindow>();
            mainWindow.Show();
        }
Esempio n. 33
0
 public FindWindowFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
Esempio n. 34
0
 public FileFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
Esempio n. 35
0
 public WindowFactory(IKernel kernel)
 {
     Kernel = kernel;
 }
Esempio n. 36
0
 public NinjectDependencyResolver()
 {
     this.kernel = new Ninject.StandardKernel();
     this.AddBindings();
 }
Esempio n. 37
0
 public static void BootStrap()
 {
     NinjectContainer = new StandardKernel();
     AddIoCBindings();
 }
Esempio n. 38
0
        private void btnProcess_Click(object sender, RoutedEventArgs e)
        {
            _inputFileName = txtCurrentMonthDataFile.Text.Trim();
            _inputFolderName = txtCurrentMonthRawDataFolder.Text.Trim();
            _inputLastMonthFileName = txtLastMonthReport.Text.Trim();
            _inputEmployeeReportName = txtEmployeeDataFile.Text.Trim();
            _outputFileName = txtOutputMonthReportFile.Text.Trim();

            if (string.IsNullOrEmpty(_inputFileName))
            {
                MessageBox.Show("Please specify the Booking&CashCollections excel report path.");
                return;
            }
            string checkRawReportFolderResult = CheckRawReportFolder();
            if (!string.IsNullOrEmpty(checkRawReportFolderResult))
            {
                MessageBox.Show(string.Format("Some required report is missing in the import excel report folder path:{0}"
                    , checkRawReportFolderResult));
                return;
            }
            if (string.IsNullOrEmpty(_inputEmployeeReportName))
            {
                MessageBox.Show("Please specify the the employee excel report path.");
                return;
            }
            if (string.IsNullOrEmpty(_outputFileName))
            {
                MessageBox.Show("Please specify the output path.");
                return;
            }

            int j;
            bool result = int.TryParse(txtYear.Text, out j);
            if (true == result)
            {
                _year = j;
            }
            else
            {
                MessageBox.Show("Please input a valid year.");
                return;
            }
            if (comboMonth.SelectedValue == null)
            {
                MessageBox.Show("Please select the month.");
                return;
            }
            ComboBoxItem monthItem = (ComboBoxItem)comboMonth.SelectedItem;
            _month = Convert.ToInt32(monthItem.Content.ToString());
            if (_month > 1 && string.IsNullOrEmpty(_inputLastMonthFileName))
            {
                MessageBox.Show("Please specify the last month's excel report path.");
                return;
            }

            IDictionary<string, string> kpiFiles = new Dictionary<string, string>();
            kpiFiles.Add(KPIReportConfig.BookingCashWorkbookFileInjectName, _inputFileName);
            kpiFiles.Add(KPIReportConfig.LastMonthWorkbookFileInjectName, _inputLastMonthFileName);
            kpiFiles.Add(KPIReportConfig.BDWorkbookFileInjectName, _bdReportFileName);
            kpiFiles.Add(KPIReportConfig.IDCProjectWorkbookFileInjectName, _idcProjectReportFileName);
            kpiFiles.Add(KPIReportConfig.IDCEmployeeWorkbookFileInjectName, _idcEmployeeReportFileName);
            kpiFiles.Add(KPIReportConfig.ProjectContributionMTDWorkbookFileInjectName, _projectContributionMTDReportFileName);
            kpiFiles.Add(KPIReportConfig.ProjectContributioYTDWorkbookFileInjectName, _projectContributionYTDReportFileName);
            kpiFiles.Add(KPIReportConfig.EmployeeWorkbookFileInjectName, _inputEmployeeReportName);
            kpiFiles.Add(KPIReportConfig.OutputPathInjectName, _outputFileName);

            kernel = new Ninject.StandardKernel(new KPIReportModule(kpiFiles, _year, _month));

            StartProcessing();
        }