Ejemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            KernelConfig.RegisterInstance <IWindowsVolumeListenerService>(new WindowsVolumeListenerService());

            var encryptionService = new EncryptionService();
            var videoFileService  = new VideoFileService();

            KernelConfig.RegisterInstance <IWindowService>(new WindowService());
            KernelConfig.RegisterInstance <IEncryptionService>(encryptionService);
            KernelConfig.RegisterInstance <IVideoFileService>(videoFileService);
            KernelConfig.RegisterInstance <IConfigurationFileService>(new ConfigurationFileService(encryptionService, videoFileService));

            KernelConfig.RegisterInstance();
            base.OnStartup(e);
        }
        public VideosTransfererService()
        {
            var encryptionService = new EncryptionService();

            _videoFileService              = new VideoFileService();
            _configurationFileService      = new ConfigurationFileService(encryptionService, _videoFileService);
            m_WindowsVolumeListenerService = new WindowsVolumeListenerService();
            _logger = new FileLogger(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs"));

            KernelConfig.RegisterInstance <ILogger>(_logger);
            KernelConfig.RegisterInstance <IEncryptionService>(encryptionService);
            KernelConfig.RegisterInstance <IVideoFileService>(_videoFileService);
            KernelConfig.RegisterInstance <IConfigurationFileService>(_configurationFileService);
            KernelConfig.RegisterInstance <IWindowsVolumeListenerService>(m_WindowsVolumeListenerService);

            InitializeComponent();
        }