コード例 #1
0
        public VlcDriver(IVlcStarter starter = null, IPortAllocator allocator = null, IVlcLocator locator = null, ILogger logger = null)
        {
            this.logger = logger;
            this.logger = this.logger ?? LogManager.GetCurrentClassLogger();

            Starter = starter ?? new VlcStarter(this.logger);

            Locator = locator ?? new VlcLocator();

            var portAllocator = allocator ?? new PortAllocator(this.logger)
            {
                StartPort = Properties.Settings.Default.StartPort
            };

            container = new WindsorContainer();
            container.Register(Component.For <VlcAudioJob>().LifestyleTransient());
            container.Register(Component.For <VlcVideoJob>().LifestyleTransient());
            container.Register(Component.For <IAudioConfiguration>().ImplementedBy <AudioConfiguration>().LifestyleTransient());
            container.Register(Component.For <IVideoConfiguration>().ImplementedBy <VideoConfiguration>().LifestyleTransient());

            container.Register(Component.For <IPortAllocator>().Instance(portAllocator));
            container.Register(Component.For <ILogger>().Instance(this.logger));

            container.Register(Component.For <IStatusParser>().ImplementedBy <StatusParser>().LifestyleTransient());
            container.Register(Component.For <IVlcStatusSource>().ImplementedBy <HttpVlcStatusSource>().LifestyleTransient());
            container.Register(Component.For <ITimeSouce>().ImplementedBy <TimeSouce>().LifestyleTransient());

            LogCurrentAssemblyInfo();
        }
コード例 #2
0
ファイル: VlcDriver.cs プロジェクト: jonlawley/VlcDriver
        public VlcDriver(IVlcStarter starter = null, IPortAllocator allocator = null, IVlcLocator locator = null, ILogger logger = null)
        {
            this.logger = logger;
            this.logger = this.logger ?? LogManager.GetCurrentClassLogger();

            Starter = starter ?? new VlcStarter(this.logger);

            Locator = locator ?? new VlcLocator();

            var portAllocator = allocator ?? new PortAllocator(this.logger){ StartPort = Properties.Settings.Default.StartPort };

            container = new WindsorContainer();
            container.Register(Component.For<VlcAudioJob>().LifestyleTransient());
            container.Register(Component.For<VlcVideoJob>().LifestyleTransient());
            container.Register(Component.For<IAudioConfiguration>().ImplementedBy<AudioConfiguration>().LifestyleTransient());
            container.Register(Component.For<IVideoConfiguration>().ImplementedBy<VideoConfiguration>().LifestyleTransient());

            container.Register(Component.For<IPortAllocator>().Instance(portAllocator));
            container.Register(Component.For<ILogger>().Instance(this.logger));

            container.Register(Component.For<IStatusParser>().ImplementedBy<StatusParser>().LifestyleTransient());
            container.Register(Component.For<IVlcStatusSource>().ImplementedBy<HttpVlcStatusSource>().LifestyleTransient());
            container.Register(Component.For<ITimeSouce>().ImplementedBy<TimeSouce>().LifestyleTransient());

            LogCurrentAssemblyInfo();
        }