示例#1
0
 /// <summary>
 /// Creates a new object with all saved profiles
 /// </summary>
 /// <param name="config">Application settings</param>
 public ProfilesHandler(IAppConfigService config)
 {
     _config       = config;
     _profFileName = Path.Combine(_config.CommonAppSettingsPath, "profiles.xml");
     InitialiseProfilesFile();
     LoadProfiles();
 }
示例#2
0
        public IoTDeviceClientService(IAppConfigService appConfigService, IDeviceInfoService deviceInfoService)
        {
            _appConfigService  = appConfigService;
            _deviceInfoService = deviceInfoService;

            LastKnownConnectionStatus = Microsoft.Azure.Devices.Client.ConnectionStatus.Disconnected;
        }
示例#3
0
        private static string BuildExecutable(bool optimized, IAppConfigService appConfig)
        {
            var fName = "oggenc2";

            if (optimized)
            {
                if (appConfig.SupportedCpuExtensions.SSE3 == 1)
                {
                    fName += "_SSE3";
                    if (Environment.Is64BitOperatingSystem && appConfig.Use64BitEncoders)
                    {
                        fName += "_64";
                    }
                }
                else if (appConfig.SupportedCpuExtensions.SSE2 == 1)
                {
                    fName += "_SSE2";
                }
                else if (appConfig.SupportedCpuExtensions.SSE == 1)
                {
                    fName += "_SSE";
                }
            }
            fName += ".exe";

            return(fName);
        }
示例#4
0
 public AppConfigController(IAppConfigService appConfigService,
                            IMapper mapper,
                            ILogger <AppConfigController> logger) : base(logger)
 {
     _appConfigService = appConfigService;
     _mapper           = mapper;
 }
示例#5
0
        public SetBaudrateViewModel(
            ModalWindowManager modalWindowManager,
            IAppConfigService appConfigService)
        {
            _modalWindowManager = modalWindowManager;
            _appConfigService   = appConfigService;

            BaudrateList = new ObservableCollection <string>
            {
                "10",
                "20",
                "50",
                "100",
                "125",
                "250",
                "500",
                "800",
                "1000"
            };

            ApplyBaudrateCmd = ReactiveCommand.Create(() =>
            {
                _appConfigService.Config.Baudrate = SelectedBaudrate;
                MessageBus.Current.SendMessage <ModalActions>(ModalActions.Close);
            });
        }
        public ValuesController(IAppConfigService appConfigService,
                                IUserService userService)
        {
            _appConfigService = appConfigService;

            _userService = userService;
        }
示例#7
0
 /// <summary>
 ///     构造函数
 /// </summary>
 /// <param name="apiAuthorize">IApiAuthorize</param>
 /// <param name="appCfgService">IAppConfigService</param>
 protected AuthorizeController(IApiAuthorize apiAuthorize, IAppConfigService appCfgService)
 {
     ValidateOperator.Begin()
     .NotNull(apiAuthorize, "IApiAuthorize")
     .NotNull(appCfgService, "IAppConfigService");
     ApiAuthorize  = apiAuthorize;
     AppCfgService = appCfgService;
 }
示例#8
0
 /// <summary>
 ///     构造函数
 /// </summary>
 /// <param name="apiAuthenticate">IApiAuthenticate</param>
 /// <param name="appCfgService">appCfgService</param>
 protected AuthenticateAttribute(IApiAuthenticate apiAuthenticate, IAppConfigService appCfgService)
 {
     ValidateOperator.Begin()
     .NotNull(apiAuthenticate, "IApiAuthenticate")
     .NotNull(appCfgService, "IAppConfigService");
     ApiAuthenticate = apiAuthenticate;
     AppCfgService   = appCfgService;
 }
 public EncodeViewModel(IShellViewModel shellViewModel, IWindowManager windowManager, IQueueProcessor queueProcessor, IAppConfigService appConfig)
 {
     _shellViewModel = shellViewModel;
     _queueProcessor = queueProcessor;
     _appConfig      = appConfig;
     WindowManager   = windowManager;
     WindowTitle     = "Encoding";
 }
示例#10
0
 public StreamSelectViewModel(IAppConfigService config, IShellViewModel shellViewModel,
                              IWindowManager windowManager, IProcessingService processing)
 {
     _shellViewModel    = shellViewModel;
     WindowManager      = windowManager;
     _configService     = config;
     _processingService = processing;
 }
 public XslTransformService(IMessageWriter messageWriter, IInputReader inputReader, IAppConfigService appConfigService)
 {
     this.messageWriter    = messageWriter ?? throw new ArgumentNullException(nameof(messageWriter));
     this.inputReader      = inputReader ?? throw new ArgumentNullException(nameof(inputReader));
     this.appConfigService = appConfigService ?? throw new ArgumentNullException(nameof(appConfigService));
     Initialize();
     appConfigService.AppConfigChanged += OnAppConfigChanged;
 }
示例#12
0
        public JiraService(IAppConfigService appConfigService)
        {
            var appConfigService1 = appConfigService;

            _jira = Jira.CreateRestClient(appConfigService1.Config.JiraConfig.Endpoint,
                                          appConfigService1.Config.JiraConfig.Username,
                                          appConfigService1.Config.JiraConfig.Password);
        }
示例#13
0
 public OptionsViewModel(IShellViewModel shellViewModel, IWindowManager windowManager, IAppConfigService config)
 {
     _shellViewModel = shellViewModel;
     WindowManager   = windowManager;
     _configService  = config;
     WindowTitle     = "Options";
     _configService.PropertyChanged += AppConfigOnSettingChanged;
 }
示例#14
0
 public MainViewModel(IShellViewModel shellViewModel, IWindowManager windowManager, IAppConfigService config,
                      IProcessingService processingService)
 {
     _shellViewModel    = shellViewModel;
     WindowManager      = windowManager;
     _configService     = config;
     _processingService = processingService;
 }
 public TheTvDbBaseController(IOptions <TheTvDbConfig> config, IAppConfigService appConfig)
 {
     _config           = config.Value;
     _appConfigService = appConfig;
     _appConfigService.TheTvDbConfig.EndPoint = _config.EndPoint;
     _appConfigService.TheTvDbConfig.ApiKey   = _config.ApiKey;
     _appConfigService.TheTvDbConfig.UserKey  = _config.UserKey;
     _appConfigService.TheTvDbConfig.Username = _config.Username;
 }
示例#16
0
        public KubernetesService(IAppConfigService appConfigService, ILogger <KubernetesService> logger)
        {
            _logger           = logger;
            _appConfigService = appConfigService;

            var config = KubernetesClientConfiguration.BuildConfigFromConfigFile("assets/config");

            _client = new Kubernetes(config);
        }
        private Email CreateEmail()
        {
            Email             email  = new Email();
            IAppConfigService config = ServiceManager.Get <IAppConfigService>();

            email.AddTo(config.GetValue("emailExceptionTo"));
            email.Subject = config.GetValue("emailExceptionSubject");

            return(email);
        }
 public ExternalDevicesModule(
     IAppConfigService appConfigService,
     IReceiverEventSink receiverEventSink,
     IReceiverEventPublisher receiverEventPublisher
     )
 {
     this.appConfigService = appConfigService;
     this.receiverEventSink = receiverEventSink;
     this.receiverEventPublisher = receiverEventPublisher;
 }
示例#19
0
        public ShellViewModel(IAppConfigService config, IProcessingService processing)
        {
            _configService     = config;
            _processingService = processing;

            DisplayWindow(ShellWin.MainView);
            Title = "Video Convert";

            _configService.PropertyChanged += ConfigServiceOnPropertyChanged;
        }
示例#20
0
        public override void FinishedInitialization()
        {
            base.FinishedInitialization();
            ServiceManager.Get <ISemanticProcessor>().Register <LoggerMembrane, LoggerReceptor>();
            IAppConfigService config = ServiceManager.Get <IAppConfigService>();

            key = config.GetValue("PaperTrailAppKey");
            UdpPaperTrail.IP   = config.GetValue("PaperTrailAppIP");
            UdpPaperTrail.Port = config.GetValue("PaperTrailAppPort").to_i();
        }
示例#21
0
 public ExternalDevicesModule(
     IAppConfigService appConfigService,
     IReceiverEventSink receiverEventSink,
     IReceiverEventPublisher receiverEventPublisher
     )
 {
     this.appConfigService       = appConfigService;
     this.receiverEventSink      = receiverEventSink;
     this.receiverEventPublisher = receiverEventPublisher;
 }
示例#22
0
        private static void StartWebServer()
        {
            IWebServerService server        = serviceManager.Get <IWebServerService>();
            IAppConfigService configService = serviceManager.Get <IAppConfigService>();
            string            ip            = configService.GetValue("ip");
            string            ports         = configService.GetValue("ports");

            int[] portVals = ports.Split(',').Select(p => p.Trim().to_i()).ToArray();
            server.Start(ip, portVals);
        }
示例#23
0
 public NetworkModule(
     IAppConfigService appConfigService,
     IScoreKeeperService scoreKeeperService,
     IStopWatchService stopWatchService,
     ReceiverEvents.ButtonPressed receiverButtonPressed)
 {
     this.appConfigService = appConfigService;
     this.scoreKeeperService = scoreKeeperService;
     this.stopWatchService = stopWatchService;
     this.receiverButtonPressed = receiverButtonPressed;
 }
示例#24
0
 public NetworkModule(
     IAppConfigService appConfigService,
     IScoreKeeperService scoreKeeperService,
     IStopWatchService stopWatchService,
     ReceiverEvents.ButtonPressed receiverButtonPressed)
 {
     this.appConfigService      = appConfigService;
     this.scoreKeeperService    = scoreKeeperService;
     this.stopWatchService      = stopWatchService;
     this.receiverButtonPressed = receiverButtonPressed;
 }
        public MultiMediaModule(
            IAppConfigService appConfigService,
            IScoreKeeperService scoreKeeperService,
            IStopWatchService stopWatchService)
        {
            this.appConfigService = appConfigService;
            this.scoreKeeperService = scoreKeeperService;
            this.stopWatchService = stopWatchService;

            this.soundEffectsService = new SoundEffectsService();
            this.speachService = new SpeechService();
        }
示例#26
0
        public MultiMediaModule(
            IAppConfigService appConfigService,
            IScoreKeeperService scoreKeeperService,
            IStopWatchService stopWatchService)
        {
            this.appConfigService   = appConfigService;
            this.scoreKeeperService = scoreKeeperService;
            this.stopWatchService   = stopWatchService;

            this.soundEffectsService = new SoundEffectsService();
            this.speachService       = new SpeechService();
        }
 public ConversionService(IAppConfigService configurationService,
                          IMessageQueueService messageQueueService,
                          ILogger <ConversionService> logger,
                          IApplicationDbContext context,
                          IHostApplicationLifetime applicationLifetime)
 {
     _configurationService = configurationService;
     _messageQueueService  = messageQueueService;
     _logger              = logger;
     _context             = context;
     _applicationLifetime = applicationLifetime;
 }
示例#28
0
        private static void StartWebServer()
        {
            ISemanticProcessor semProc = serviceManager.Get <ISemanticProcessor>();

            semProc.Register <WebServerMembrane, AccountRouteReceptor>();

            IWebServerService server        = serviceManager.Get <IWebServerService>();
            IAppConfigService configService = serviceManager.Get <IAppConfigService>();
            string            ip            = configService.GetValue("ip");
            string            ports         = configService.GetValue("ports");

            int[] portVals = ports.Split(',').Select(p => p.Trim().to_i()).ToArray();
            server.Start(ip, portVals);
        }
示例#29
0
 public JobService(IApplicationDbContext context, IDockerService dockerService,
                   IKubernetesService kubernetesService, IDateTime dateTime,
                   IMessageQueueService messageQueueService, ILogger <JobService> logger,
                   IAppConfigService configurationService, IMapper mapper)
 {
     _context             = context;
     _dockerService       = dockerService;
     _kubernetesService   = kubernetesService;
     _messageQueueService = messageQueueService;
     _dateTime            = dateTime;
     _mapper = mapper;
     _logger = logger;
     _configurationService = configurationService;
     _messageQueueService.MessageReceivedEventHandler += messageQueueService_MessageReceivedEventHandlerAsync;
 }
        public DataStore(IAppConfigService appConfigService)
        {                
            // ReSharper disable once UseObjectOrCollectionInitializer
            this.documentStore = new EmbeddableDocumentStore
                                    {
                                        DataDirectory = appConfigService.GetDatabaseConnectionString(),                                                                                
                                    };

#if DEBUG
            this.documentStore.UseEmbeddedHttpServer = true;
#else 
            this.documentStore.UseEmbeddedHttpServer = false;
#endif

            this.documentStore.Initialize();
            this.documentStore.RegisterListener(new NonStaleQueryListener());
        }
        public MainWindowViewModel(
            NotificationViewModel notificationViewModel,
            SetupViewModel setupMenuViewModel,
            CommandsViewModel commandsViewModel,
            MainViewModel mainViewViewModel,
            IAppConfigService appConfigService,
            ModalWindowManager modalWindowManager)
        {
            SetupMenuViewModel = setupMenuViewModel;
            CommandsViewModel  = commandsViewModel;
            Notification       = notificationViewModel;
            MainViewViewModel  = mainViewViewModel;
            AppConfigService   = appConfigService;
            ModalWindowManager = modalWindowManager;

            Content = MainViewViewModel;
        }
示例#32
0
        public static void MainLoop(IAppConfigService appConfigService, XslTransformService xslTransformService)
        {
            string response = "";

            do
            {
                Console.Clear();
                Console.WriteLine("Welcome to XSL Transform App");
                Console.WriteLine($"Current working directory: {appConfigService.WorkingDirectory}");
                Console.WriteLine($"Current stylesheet: {appConfigService.XslFile}");
                Console.WriteLine($"Current xml file to transform: {appConfigService.XmlFile}");
                Console.WriteLine(Environment.NewLine);
                Console.WriteLine("1. Change working directory.");
                Console.WriteLine("2. Change currentstylesheet.");
                Console.WriteLine("3. Change current xml file.");
                Console.WriteLine("4. Transform!");
                Console.WriteLine("Q. Quit");
                response = GetResponse(new List <string> {
                    "1", "2", "3", "4", "Q", "q"
                });

                switch (response)
                {
                case "1":
                    appConfigService.SetWorkingDirectory();
                    break;

                case "2":
                    appConfigService.SetXslFile();
                    break;

                case "3":
                    appConfigService.SetXmlFile();
                    break;

                case "4":
                    xslTransformService.Transform();
                    break;

                default:
                    break;
                }
            } while (response != "Q" && response != "q");
        }
示例#33
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueProcessor"/> class.
        /// </summary>
        /// <param name="appConfig">
        /// Application configuration
        /// </param>
        /// <param name="processingService">
        /// Processing Service
        /// </param>
        /// <param name="ffmpegGetCrop">
        /// ffmpeg crop interface
        /// </param>
        /// <param name="ffmsIndex">
        /// ffmsindex interface
        /// </param>
        /// <param name="eac3To">
        /// eac3to interface
        /// </param>
        /// <param name="ffmpegDemuxer">
        /// ffmpeg demux interface
        /// </param>
        /// <param name="mplayerDemuxer">
        /// mplayer demux interface
        /// </param>
        /// <param name="mkvExtractSubtitle">
        /// mkvextract subtitle demux interface
        /// </param>
        /// <param name="demuxerTsMuxeR">
        /// tsMuxeR demux interface
        /// </param>
        /// <param name="bdSup2Sub">
        /// BDSup2Sub interface
        /// </param>
        /// <param name="ffmpegAc3">
        /// ffmpeg AC-3 encoder Interface
        /// </param>
        /// <param name="ffmpegDvd">
        /// ffmpeg DVD encoder Interface
        /// </param>
        /// <param name="lame">
        /// lame encoder Interface
        /// </param>
        /// <param name="neroAac">
        /// NeroAacEnc Interface
        /// </param>
        /// <param name="oggEnc">
        /// OggEnc Interface
        /// </param>
        /// <param name="x264">
        /// x264 encoder Interface
        /// </param>
        /// <param name="ffmpegX264">
        /// ffmpeg x264 encoder Interface
        /// </param>
        /// <param name="fileWorker">
        /// FileWorker Interface
        /// </param>
        /// <param name="dvdAuthor">
        /// DVDAuthor Interface
        /// </param>
        /// <param name="mkvMerge">
        /// mkvMerge Interface
        /// </param>
        /// <param name="mp4Box">
        /// mp4box Interface
        /// </param>
        /// <param name="mplex">
        /// Mplex Interface
        /// </param>
        /// <param name="spuMux">
        /// SpuMux Interface
        /// </param>
        /// <param name="tsMuxeR">
        /// tsMuxeR Interface
        /// </param>
        public QueueProcessor(IAppConfigService appConfig, IProcessingService processingService,
                              //decoder
                              IDecoderFfmpegGetCrop ffmpegGetCrop, IDecoderFfmsIndex ffmsIndex,
                              //demuxer
                              IDemuxerEac3To eac3To, IDemuxerFfmpeg ffmpegDemuxer,
                              IDemuxerMplayer mplayerDemuxer, IDemuxerMkvExtractSubtitle mkvExtractSubtitle,
                              IDemuxerTsMuxeR demuxerTsMuxeR,
                              //encoder
                              IEncoderBdSup2Sub bdSup2Sub, IEncoderFfmpegAc3 ffmpegAc3,
                              IEncoderFfmpegDvd ffmpegDvd, IEncoderLame lame, IEncoderNeroAac neroAac,
                              IEncoderOggEnc oggEnc, IEncoderX264 x264, IEncoderFfmpegX264 ffmpegX264,
                              //muxer
                              IFileWorker fileWorker, IMuxerDvdAuthor dvdAuthor, IMuxerMkvMerge mkvMerge,
                              IMuxerMp4Box mp4Box, IMuxerMplex mplex, IMuxerSpuMux spuMux, IMuxerTsMuxeR tsMuxeR)
        {
            _appConfig         = appConfig;
            _processingService = processingService;

            _ffmpegGetCrop = ffmpegGetCrop;
            _ffmsIndex     = ffmsIndex;

            _eac3To             = eac3To;
            _ffmpegDemuxer      = ffmpegDemuxer;
            _mplayerDemuxer     = mplayerDemuxer;
            _mkvExtractSubtitle = mkvExtractSubtitle;
            _demuxerTsMuxeR     = demuxerTsMuxeR;

            _bdSup2Sub  = bdSup2Sub;
            _ffmpegAc3  = ffmpegAc3;
            _ffmpegDvd  = ffmpegDvd;
            _lame       = lame;
            _neroAac    = neroAac;
            _oggEnc     = oggEnc;
            _x264       = x264;
            _ffmpegX264 = ffmpegX264;

            _fileWorker = fileWorker;
            _dvdAuthor  = dvdAuthor;
            _mkvMerge   = mkvMerge;
            _mp4Box     = mp4Box;
            _mplex      = mplex;
            _spuMux     = spuMux;
            _tsMuxeR    = tsMuxeR;
        }
示例#34
0
        public SetPortViewModel(
            ModalWindowManager modalWindowManager,
            IAppConfigService appConfigService)
        {
            _modalWindowManager = modalWindowManager;
            _appConfigService   = appConfigService;

            RefreshPortList = ReactiveCommand.Create(() =>
            {
                PortList?.Clear();
                PortList = new ObservableCollection <string>(SerialPort.GetPortNames());
            });

            AppyPort = ReactiveCommand.Create(() =>
            {
                _appConfigService.Config.Port = SelectedPort;
                MessageBus.Current.SendMessage <ModalActions>(ModalActions.Close);
            });

            RefreshPortList.Execute().Subscribe();
        }