Пример #1
0
        public override void Run()
        {
            var kernel =
                new StandardKernel(Assembly.GetExecutingAssembly().LoadConfiguredProfileMantleModules().ToArray());

            var dependencyResolver = new NinjectDependencyResolver(kernel);

            MantleContext.Current = new MantleContext();
            MantleContext.Current.DependencyResolver = dependencyResolver;

            var workerHost = new AzureCloudServiceRoleWorkerHost(dependencyResolver.Get <IWorker>());

            workerHost.Start();
        }
Пример #2
0
        private static void Main(string[] args)
        {
            var kernel =
                new StandardKernel(Assembly.GetExecutingAssembly().LoadConfiguredProfileMantleModules().ToArray());

            var dependencyResolver = new NinjectDependencyResolver(kernel);

            MantleContext.Current = new MantleContext();
            MantleContext.Current.DependencyResolver = dependencyResolver;

            var workerHost = new ConsoleWorkerHost(dependencyResolver.Get <IWorker>());

            workerHost.Start();
        }
Пример #3
0
        public override void Run()
        {
            var kernel =
                new StandardKernel(Assembly.GetExecutingAssembly().LoadConfiguredProfileMantleModules().ToArray());

            var dependencyResolver = new NinjectDependencyResolver(kernel);

            MantleContext.Current = new MantleContext();
            MantleContext.Current.DependencyResolver = dependencyResolver;

            var workerHost = new AzureCloudServiceRoleWorkerHost(dependencyResolver.Get<IWorker>());

            workerHost.Start();
        }
Пример #4
0
        private static void Main()
        {
            IDependencyResolver dependencyResolver = new NinjectDependencyResolver();
            dependencyResolver.Bind<IDependencyResolver>().ToConstant(dependencyResolver);
            dependencyResolver.Bind<IFingerprintService>().To<FingerprintService>();
            dependencyResolver.Bind<IWindowFunction>().To<HanningWindow>();
            dependencyResolver.Bind<IWaveletDecomposition>().To<HaarWavelet>();
            dependencyResolver.Bind<IFingerprintDescriptor>().To<FingerprintDescriptor>();
            dependencyResolver.Bind<IFingerprintingConfiguration>().To<DefaultFingerprintingConfiguration>();
            dependencyResolver.Bind<IAudioService>().To<BassAudioService>();
            dependencyResolver.Bind<ITagService>().To<TagService>();
            dependencyResolver.Bind<IWorkUnitBuilder>().To<WorkUnitBuilder>();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(dependencyResolver.Get<WinMain>());
        }