Пример #1
0
        public bool UploadCostcoFA(string fileName, IAppSettingsService appSettings)
        {
            string encryptedFilePath = Path.Combine(appSettings.Costco.Dir.Encrypt.FAs.Path, fileName);

            CostcoCHFtp costcoFtp = new CostcoCHFtp();
            return costcoFtp.UploadFA(encryptedFilePath);
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IMessageDlgService messageDlgService, 
            IProgressDialogService progressDialogService, IAppSettingsService stgsService, ITimePusher timePusherService)
        {
            this.progressDialogService = progressDialogService;
            this.messageDlgService = messageDlgService;
            this.stgsService = stgsService;
            this.timePusherService = timePusherService;
            this.Settings = this.stgsService.ReadSettings();

            this.PostTimeEntries = new RelayCommand(async () =>
            {
                await this.DoOp(() => this.timePusherService.PushTime(this.Settings, DateTime.Now.AddDays(-7).Date, DateTime.Now.AddDays(1).Date), "posting logged time for today", "Time entries for today have been successfully posted.");
            });

            this.ClosingCommand = new RelayCommand(() =>
            {
                this.stgsService.SaveSettings(this.Settings);
            });


            ////if (IsInDesignMode)
            ////{
            ////    // Code runs in Blend --> create design time data.
            ////}
            ////else
            ////{
            ////    // Code runs "for real"
            ////}
        }
 public AdminController(IProjectRepository projectRepository, IDataCollectionRepository dataCollectionRepository, ICsvHelper csvHelper, IAppSettingsService appSettingsService, IBus bus)
 {
     _csvHelper = csvHelper;
     _appSettingsService = appSettingsService;
     _bus = bus;
     _projectRepository = projectRepository;
     _dataCollectionRepository = dataCollectionRepository;
 }
Пример #4
0
        public EventLogLoggerService(IAppSettingsService appSettingsService)
        {
            _appSettingsService = appSettingsService;
            _eventLog = new EventLog() { Log = "Application", Source = _appSettingsService.ServiceName };

            if (!EventLog.SourceExists(_eventLog.Source))
                EventLog.CreateEventSource(_eventLog.Source, _eventLog.Log);
        }
Пример #5
0
        public FileInfo DownloadCostoOrder(string fileName, IAppSettingsService appSettings)
        {
            string encryptedFilePath = Path.Combine(appSettings.Costco.Dir.Encrypt.Orders.Path, fileName);

            CostcoCHFtp costcoFtp = new CostcoCHFtp();
            costcoFtp.DownloadOrder(fileName, encryptedFilePath, true);

            return new FileInfo(encryptedFilePath);
        }
 public StartupInteractor(INoiseDetectionService noiseDetectionService,
                          IDefaultUserUseCase defaultUserInteractor,
                          IAppSettingsService appSettingsService,
                          IHandShakeUseCase setupInteractor)
 {
     this._noiseDetectionService = noiseDetectionService;
     this._defaultUserInteractor = defaultUserInteractor;
     this._appSettingsService    = appSettingsService;
     this._setupInteractor       = setupInteractor;
 }
Пример #7
0
 public SettingsAboutViewModel(
     ITextProvider textProvider,
     IMvxMessenger messenger,
     ILogger logger,
     IMvxNavigationService navigationService,
     IAppSettingsService appSettings,
     ITelemetryService telemetryService)
     : base(textProvider, messenger, logger.ForContext <SettingsMainViewModel>(), navigationService, appSettings, telemetryService)
 {
 }
Пример #8
0
        public FileInfo DownloadCostoOrder(string fileName, IAppSettingsService appSettings)
        {
            string encryptedFilePath = Path.Combine(appSettings.Costco.Dir.Encrypt.Orders.Path, fileName);

            CostcoCHFtp costcoFtp = new CostcoCHFtp();

            costcoFtp.DownloadOrder(fileName, encryptedFilePath, true);

            return(new FileInfo(encryptedFilePath));
        }
 public DeleteAccountDialogViewModel(
     ITextProvider textProvider,
     IMvxMessenger messenger,
     ILogger logger,
     IMvxNavigationService navigationService,
     IAppSettingsService appSettings,
     ITelemetryService telemetryService)
     : base(textProvider, messenger, logger.ForContext <DeleteAccountDialogViewModel>(), navigationService, appSettings, telemetryService)
 {
 }
 public AskBeforeDiscardChangesDialogViewModel(
     ITextProvider textProvider,
     IMvxMessenger messenger,
     ILogger logger,
     IMvxNavigationService navigationService,
     IAppSettingsService appSettings,
     ITelemetryService telemetryService)
     : base(textProvider, messenger, logger.ForContext <AskBeforeDiscardChangesDialogViewModel>(), navigationService, appSettings, telemetryService)
 {
 }
Пример #11
0
        public LockFingerprintPage(bool checkFingerprintImmediately)
        {
            _checkFingerprintImmediately = checkFingerprintImmediately;
            _fingerprint       = Resolver.Resolve <IFingerprint>();
            _settings          = Resolver.Resolve <ISettings>();
            _appSettings       = Resolver.Resolve <IAppSettingsService>();
            _deviceInfoService = Resolver.Resolve <IDeviceInfoService>();

            Init();
        }
Пример #12
0
 public AnalysisService(
     IQuoteService quoteService,
     ITradeService tradeService,
     IAppSettingsService configs
     )
 {
     _quoteService = quoteService;
     _tradeService = tradeService;
     _configs = configs;
 }
Пример #13
0
 public AdminController(IQuestionService questionService, ICacheService cacheService,
                        IAppSettingsService appSettingsService, ICategoryService categoryService,
                        IPaymentService paymentService)
 {
     this._questionService    = questionService;
     this._cacheService       = cacheService;
     this._appSettingsService = appSettingsService;
     this._categoryService    = categoryService;
     this._paymentService     = paymentService;
 }
Пример #14
0
        public SettingsViewModel(INavigationService navigationService, IAppSettingsViewModel appSettings, IProjectSettingsViewModel projectSettings, IAppSettingsService appSettingsService, IProjectSettingsService projectSettingsService)
        {
            _appSettingsService     = appSettingsService;
            _projectSettingsService = projectSettingsService;
            AppSettings             = appSettings;
            ProjectSettings         = projectSettings;

            SaveCommand = new RelayCommand(p => ExecuteSave());
            BackCommand = new RelayCommand(p => navigationService.NavigateBack());
        }
Пример #15
0
 public BucketViewModel(
     IAppSettingsService settingsService,
     IBucketsService bucketService,
     IUsersService usersService)
 {
     this.settingsService = settingsService;
     this.bucketService   = bucketService;
     this.usersService    = usersService;
     bucketValidator      = new BucketValidator();
 }
        public SettingsService(ISettings settings, IAppSettingsService appSettings)
        {
            // Init user device settings
            _settings = settings;
            SetDefaultValues();
            _settings.Bind(this);
            //_settings.KeysNotToClear.Add($"{GetType().FullName}.{nameof(UnclearableString)}");

            // Load json app settings
            AppSettings = appSettings;
        }
Пример #17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TorrentService"/> class.
        /// </summary>
        /// <param name="torrentRepository">The torrent repository.</param>
        /// <param name="appSettingsService">The application settings service.</param>
        /// <param name="session">The session.</param>
        /// <param name="metadataService">The metadata service.</param>
        /// <param name="subtitleService">The subtitle service.</param>
        public TorrentService(IDataRepository <TorrentEntity> torrentRepository, IAppSettingsService appSettingsService,
                              ISession session, IMetadataService metadataService)
        {
            _torrentRepository  = torrentRepository;
            _appSettingsService = appSettingsService;
            _session            = session;
            _metadataService    = metadataService;

            StartTorrentEngine();
            StartTorrentStatsUpdater();
        }
Пример #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SyncPairUpMembersActivity"/> class.
 /// </summary>
 /// <param name="memberService">Teams member service.</param>
 /// <param name="appSettingsService">App settings service.</param>
 /// <param name="teamUserPairUpMappingRepository">Team user pair-up mapping repository.</param>
 /// <param name="options">A set of key/value application configuration properties for application settings.</param>
 public SyncPairUpMembersActivity(
     ITeamMembersService memberService,
     IAppSettingsService appSettingsService,
     TeamUserPairUpMappingRepository teamUserPairUpMappingRepository,
     IOptions <ConfidentialClientApplicationOptions> options)
 {
     this.memberService      = memberService ?? throw new ArgumentNullException(nameof(memberService));
     this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
     this.teamUserPairUpMappingRepository = teamUserPairUpMappingRepository ?? throw new ArgumentNullException(nameof(teamUserPairUpMappingRepository));
     this.options = options ?? throw new ArgumentNullException(nameof(options));
 }
        public SettingsService(ISettings settings, IAppSettingsService appSettings)
        {
            _settings   = settings;
            AppSettings = appSettings;
            SetDefaultValues();
            _settings.Bind(this);

            _authenticationStatusChanged = new BehaviorSubject <bool>(IsAuthenticated);
            this.WhenAnyValue(x => x.AuthToken)
            .Subscribe(_ => _authenticationStatusChanged.OnNext(IsAuthenticated));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TeamsDataCapture"/> class.
 /// </summary>
 /// <param name="teamDataRepository">Team data repository instance.</param>
 /// <param name="userDataRepository">User data repository instance.</param>
 /// <param name="appSettingsService">App Settings service.</param>
 /// <param name="cardHelper">Instance of class that handles adaptive card helper methods.</param>
 public TeamsDataCapture(
     TeamDataRepository teamDataRepository,
     UserDataRepository userDataRepository,
     IAppSettingsService appSettingsService,
     CardHelper cardHelper)
 {
     this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository));
     this.userDataRepository = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository));
     this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
     this.cardHelper         = cardHelper ?? throw new ArgumentNullException(nameof(cardHelper));
 }
Пример #21
0
 public LockService(
     ISettings settings,
     IAppSettingsService appSettings,
     IAuthService authService,
     IFingerprint fingerprint)
 {
     _settings    = settings;
     _appSettings = appSettings;
     _authService = authService;
     _fingerprint = fingerprint;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthorTeamsActivityHandler"/> class.
 /// </summary>
 /// <param name="teamsFileUpload">File upload service.</param>
 /// <param name="userDataService">User data service.</param>
 /// <param name="appSettingsService">App Settings service.</param>
 /// <param name="localizer">Localization service.</param>
 public AuthorTeamsActivityHandler(
     TeamsFileUpload teamsFileUpload,
     IUserDataService userDataService,
     IAppSettingsService appSettingsService,
     IStringLocalizer <Strings> localizer)
 {
     this.userDataService    = userDataService ?? throw new ArgumentNullException(nameof(userDataService));
     this.teamsFileUpload    = teamsFileUpload ?? throw new ArgumentNullException(nameof(teamsFileUpload));
     this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
     this.localizer          = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
Пример #23
0
        public async Task Initialize()
        {
            this.settingsService = new AppSettingsService(new InMemorySettingsProvider())
            {
                EnableClipboardTimer  = DefaultClearEnabled,
                ClearClipboardOnTimer = DefaultClearTime
            };

            this.viewModel = new SettingsBasedClipboardClearViewModel(new ThreadPoolTimerFactory(), new MockSyncContext(), this.settingsService);
            await this.viewModel.ActivateAsync();
        }
Пример #24
0
 public MiraiNotesDataService(
     IUserDataService userDataService,
     ITaskListDataService taskListDataService,
     ITaskDataService taskDataService,
     IAppSettingsService appSettings,
     ILogger logger)
 {
     MiraiNotesContext.Init(appSettings, logger.ForContext <MiraiNotesDataService>());
     UserService     = userDataService;
     TaskListService = taskListDataService;
     TaskService     = taskDataService;
 }
Пример #25
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="repository">Repository</param>
 public SmsBotService(IRepository repository, IFamilyService familyService, IChoreService choreService, IAppSettingsService appSettingsService,
                      IEarningsService earningsService, IRecurringChoreService recurringChoreService,
                      ITextMessageService textMessageService, ISMSApprovalService smsApprovalService) : base(repository)
 {
     _familyService         = familyService;
     _choreService          = choreService;
     _appSettingsService    = appSettingsService;
     _earningsService       = earningsService;
     _recurringChoreService = recurringChoreService;
     _textMessageService    = textMessageService;
     _smsApprovalService    = smsApprovalService;
 }
Пример #26
0
        public OverviewViewModel(
            IAppSettingsService settingsService,
            ICocktailsService cocktailsService,
            ISeederService seederService)
        {
            this.settingsService  = settingsService;
            this.cocktailsService = cocktailsService;
            this.seederService    = seederService;

            this.seederService.EnsureSeeded();
            Cocktails = new ObservableCollection <Cocktail>(cocktailsService.GetAllCocktails().Result);
        }
Пример #27
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="repository">Repository</param>
 public TransactionService(IRepository repository, IEmailTemplateService emailTemplateService,
                           IEmailService emailService, IAllocationSettingsService allocationSettingsService, IAppSettingsService appSettingsService,
                           ITextMessageService textMessageService, ICoreProService coreProService, IBankService bankService) : base(repository)
 {
     _emailTemplateService      = emailTemplateService;
     _emailService              = emailService;
     _allocationSettingsService = allocationSettingsService;
     _appSettingsService        = appSettingsService;
     _textMessageService        = textMessageService;
     _coreProService            = coreProService;
     _bankService = bankService;
 }
 /// <summary>
 /// Constructor method
 /// </summary>
 /// <param name="logger">ILogger&lt;CustomAuthorizeFilter&gt;</param>
 /// <param name="appSettings">IAppSettingsService</param>
 /// <param name="userManager">UserManager&lt;ApplicationUser&gt;</param>
 /// <param name="permissions">List&lt;string&gt;</param>
 /// <method>
 /// CustomAuthorizeFilter(
 ///     ILogger&lt;CustomAuthorizeFilter&gt; logger,
 ///     IAppSettingsService appSettings,
 ///     UserManager&lt;ApplicationUser&gt; userManager,
 ///     List&lt;string&gt; permissions
 /// )
 /// </method>
 public CustomAuthorizeFilter(
     ILogger <CustomAuthorizeFilter> logger,
     IAppSettingsService appSettings,
     UserManager <ApplicationUser> userManager,
     List <string> permissions
     )
 {
     _logger      = new Logger(logger);
     _appSettings = appSettings;
     _userManager = userManager;
     _permissions = permissions;
 }
        public ConfigurationService(
            IAppSettingsService appSettingsService,
            ISolutionModeConfigurationService configurationAppService,
            IInformationPublishingService informationPublishingService)
        {
            _configurationAppService      = configurationAppService;
            _informationPublishingService = informationPublishingService;

            var configurationDirectory = appSettingsService.GetConfigurationDirectory();

            configurationAppService.Initialize(configurationDirectory);
        }
Пример #30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SentNotificationsController"/> class.
        /// </summary>
        /// <param name="channelDataRepository">Channel data repository service that deals with the table storage in azure.</param>
        /// <param name="notificationDataRepository">Notification data repository service that deals with the table storage in azure.</param>
        /// <param name="sentNotificationDataRepository">Sent notification data repository.</param>
        /// <param name="sentNotificationUpdateDataRepository">Sent update notification data repository.</param>
        /// <param name="sentNotificationDataRepstry">Sent notification data repository to Get Likes.</param>
        /// <param name="teamDataRepository">Team data repository instance.</param>
        /// <param name="distributionListDataRepository">DistributionList data repository instance.</param>
        /// <param name="prepareToSendQueue">The service bus queue for preparing to send notifications.</param>
        /// <param name="sendQueue">The service bus queue for the send queue.</param>
        /// <param name="dataQueue">The service bus queue for the data queue.</param>
        /// <param name="dataQueueMessageOptions">The options for the data queue messages.</param>
        /// <param name="groupsService">The groups service.</param>
        /// <param name="memberService">The meber info service.</param>
        /// <param name="reactionService">The reaction of message service.</param>
        /// <param name="exportDataRepository">The Export data repository instance.</param>
        /// <param name="appCatalogService">App catalog service.</param>
        /// <param name="appSettingsService">App settings service.</param>
        /// <param name="userAppOptions">User app options.</param>
        /// <param name="loggerFactory">The logger factory.</param>
        /// <param name="configuration">The Configuration.</param>
        /// <param name="botOptions">bot options.</param>
        public SentNotificationsController(
            IChannelDataRepository channelDataRepository,
            INotificationDataRepository notificationDataRepository,
            ISentUpdateandDeleteNotificationDataRepository sentNotificationDataRepository,
            ISentUpdateDataRepository sentNotificationUpdateDataRepository,
            ISentNotificationDataRepository sentNotificationDataRepstry,
            ITeamDataRepository teamDataRepository,
            IDistributionListDataRepository distributionListDataRepository,
            IPrepareToSendQueue prepareToSendQueue,
            ISendQueue sendQueue,
            IDataQueue dataQueue,
            IOptions <DataQueueMessageOptions> dataQueueMessageOptions,
            IGroupsService groupsService,
            IMessageReactionService reactionService,
            ITeamMembersService memberService,
            IExportDataRepository exportDataRepository,
            IAppCatalogService appCatalogService,
            IAppSettingsService appSettingsService,
            IOptions <UserAppOptions> userAppOptions,
            ILoggerFactory loggerFactory,
            IConfiguration configuration,
            IOptions <BotOptions> botOptions)
        {
            if (dataQueueMessageOptions is null)
            {
                throw new ArgumentNullException(nameof(dataQueueMessageOptions));
            }

            var options = botOptions ?? throw new ArgumentNullException(nameof(botOptions));

            this.channelDataRepository                = channelDataRepository ?? throw new ArgumentNullException(nameof(channelDataRepository));
            this.notificationDataRepository           = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
            this.sentNotificationDataRepository       = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository));
            this.sentNotificationUpdateDataRepository = sentNotificationUpdateDataRepository ?? throw new ArgumentException(nameof(sentNotificationUpdateDataRepository));
            this.sentNotificationDataRepstry          = sentNotificationDataRepstry ?? throw new ArgumentNullException(nameof(sentNotificationDataRepstry));
            this.teamDataRepository             = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository));
            this.distributionListDataRepository = distributionListDataRepository ?? throw new ArgumentNullException(nameof(distributionListDataRepository));
            this.prepareToSendQueue             = prepareToSendQueue ?? throw new ArgumentNullException(nameof(prepareToSendQueue));
            this.sendQueue = sendQueue ?? throw new ArgumentNullException(nameof(sendQueue));
            this.dataQueue = dataQueue ?? throw new ArgumentNullException(nameof(dataQueue));
            this.forceCompleteMessageDelayInSeconds = dataQueueMessageOptions.Value.ForceCompleteMessageDelayInSeconds;
            this.groupsService        = groupsService ?? throw new ArgumentNullException(nameof(groupsService));
            this.reactionService      = reactionService ?? throw new ArgumentNullException(nameof(reactionService));
            this.memberService        = memberService ?? throw new ArgumentNullException(nameof(memberService));
            this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
            this.appCatalogService    = appCatalogService ?? throw new ArgumentNullException(nameof(appCatalogService));
            this.appSettingsService   = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
            this.userAppOptions       = userAppOptions?.Value ?? throw new ArgumentNullException(nameof(userAppOptions));
            this.logger        = loggerFactory?.CreateLogger <SentNotificationsController>() ?? throw new ArgumentNullException(nameof(loggerFactory));
            this.account       = string.Empty;
            this.configuration = configuration;
        }
Пример #31
0
        public GenerationDataViewModel(IAppDialogsService appDialogsService, IAppWindowsService appWindowsService, IGeneratorService generatorService,
                                       ISystemService sysService, IAppSettingsService appSettingsService)
        {
            this.appDialogsService  = appDialogsService;
            this.appWindowsService  = appWindowsService;
            this.generatorService   = generatorService;
            this.sysService         = sysService;
            this.appSettingsService = appSettingsService;

            UseTemplateCommand = new DelegateCommand(UseTemplate, () => SelectedTemplate?.Handler != null);

            InitializeTemplates();
        }
Пример #32
0
        #pragma warning restore 67

        public MainViewModel(IMyDialogService dlg, IBusyService busy, IAppSettingsService settings)
        {
            this.DialogSrv   = dlg;
            this.BusySrv     = busy;
            this.settingsSrv = settings;

            AvailableTransportTypes = EnumHelper.ListOf <TransportType>();
            AvailableDevices        = new ObservableCollection <NanoDeviceBase>();

            SelectedDevice = null;
            SelectedDeviceConnectionResult = PingConnectionResult.None;
            IsBusyHeader = false;
        }
 public CharityService(IRepository repository, ICurrentUserService currentUserService, ITransactionService transactionService,
                       IEarningsService earningsService, IBankService bankService, ITextMessageService textMessageService,
                       IAppSettingsService appSettingsService, ISMSApprovalHistory smsApprovalHistory, IFamilyService familyService) : base(repository)
 {
     _currentUserService = currentUserService;
     _transactionService = transactionService;
     _earningsService    = earningsService;
     _bankService        = bankService;
     _textMessageService = textMessageService;
     _appSettingsService = appSettingsService;
     _smsApprovalHistory = smsApprovalHistory;
     _familyService      = familyService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SendPairUpNotificationFunction"/> class.
 /// </summary>
 /// <param name="messageService">Message service.</param>
 /// <param name="userDataRepository">User data repository.</param>
 /// <param name="appSettingsService">App settings service.</param>
 /// <param name="memoryCache">MemoryCache instance for caching authorization result.</param>
 /// <param name="localizer">Localization service.</param>
 public SendPairUpNotificationFunction(
     IMessageService messageService,
     UserDataRepository userDataRepository,
     IAppSettingsService appSettingsService,
     IMemoryCache memoryCache,
     IStringLocalizer <Strings> localizer)
 {
     this.messageService     = messageService ?? throw new ArgumentNullException(nameof(messageService));
     this.userDataRepository = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository));
     this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
     this.memoryCache        = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));
     this.localizer          = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
 public void SetUp()
 {
     const string payload = @"<link href='global.css' type='text/css' /><div>Hello World</div>";
     _account = 1470;
     _item = 7418569;
     _autoSubstitute = AutoSubstituteContainer.Create();
     _appSettingsService = _autoSubstitute.Resolve<IAppSettingsService>();
     _simpleWebRequestService = _autoSubstitute.Resolve<ISimpleWebRequestService>();
     _simpleWebRequestService.GetResponseText(Arg.Any<string>()).Returns(payload);
     var libGuideService = new LibGuideService(_simpleWebRequestService, _appSettingsService);
     _autoSubstitute.Provide<ILibGuideService>(libGuideService);
     _controller = _autoSubstitute.Resolve<LibGuideController>();
 }
Пример #36
0
 public EFxService(ILogService logService, IWorkerService workerService, ITradingDao tradingDao, IAppSettingsService appSettingsService)
 {
     _logService = logService;
     _workerService = workerService;
     _tradingDao = tradingDao;
     _appSettingsService = appSettingsService;
     InitializeComponent();
     ServiceName = ConfigurationManager.AppSettings["serviceName"];
     _immediateExecutionTimer = new Timer { AutoReset = false, Interval = 1 };
     _immediateExecutionTimer.Elapsed += Run;
     _timer = new Timer { AutoReset = true, Interval = Interval };
     _timer.Elapsed += Run;
 }
Пример #37
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // Ensure the current culture passed into bindings is the OS culture.
            // By default, WPF uses en-US as the culture, regardless of the system settings.
            // see: https://stackoverflow.com/a/520334/704281
            FrameworkElement.LanguageProperty.OverrideMetadata(
                typeof(FrameworkElement),
                new FrameworkPropertyMetadata(System.Windows.Markup.XmlLanguage.GetLanguage(System.Globalization.CultureInfo.CurrentCulture.IetfLanguageTag)));

            Application.Current.Resources.MergedDictionaries[0] = ResourceDictionaryTranslationService.ResourceDictionary;

            _notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");

            var container = TinyIoCContainer.Current;

            RegisterServices(container);

            UseRepositoryMonitor(container);
            UseExplorerHandler(container);
            PreloadRepositoryActions(container);

            _updateTimer = new Timer(async state => await CheckForUpdatesAsync(), null, 5000, Timeout.Infinite);

            // We noticed that the hotkey registration causes a high CPU utilization if the window was not shown before.
            // To fix this, we need to make the window visible in EnsureWindowHandle() but we set the opacity to 0.0 to prevent flickering
            var window = container.Resolve <MainWindow>();

            EnsureWindowHandle(window);

            _hotkey = new HotKey(47110815);
            _hotkey.Register(window, HotKey.VK_R, HotKey.MOD_ALT | HotKey.MOD_CTRL, OnHotKeyPressed);

            _ipcServer = new IpcServer(new DefaultIpcEndpoint(), this);
            _ipcServer.Start();

            _settings = container.Resolve <IAppSettingsService>();

            if (_settings.MenuWidth > 0)
            {
                window.Width = _settings.MenuWidth;
            }

            if (_settings.MenuHeight > 0)
            {
                window.Height = _settings.MenuHeight;
            }

            window.SizeChanged += WindowOnSizeChanged;
        }
 public DeleteTaskListDialogViewModel(
     ITextProvider textProvider,
     IMvxMessenger messenger,
     ILogger logger,
     IMvxNavigationService navigationService,
     IAppSettingsService appSettings,
     ITelemetryService telemetryService,
     IMiraiNotesDataService dataService,
     IDialogService dialogService)
     : base(textProvider, messenger, logger, navigationService, appSettings, telemetryService)
 {
     _dataService   = dataService;
     _dialogService = dialogService;
 }
Пример #39
0
 public CcReadController(IAppSettingsService appSettingsService, IFileService fileService, IComHubModelService comHubService)
 {
     appSettings = appSettingsService;
     fileSrvc = fileService;
     comHubSrvc = comHubService;
 }
Пример #40
0
 private static void RunUserControlled(string[] args, ILogService logService, IWorkerService workerService, ITradingDao tradingDao, IAppSettingsService appSettingsService)
 {
     var eFxService = new EFxService(logService, workerService, tradingDao, appSettingsService);
     eFxService.StartService();
 }
Пример #41
0
 public CcEncryptController(IAppSettingsService appSettingsService, IFileService fileService, IGnuPGService gnuPGService)
 {
     appSettings = appSettingsService;
     fileSrvc = fileService;
     gnuPG = gnuPGService;
 }
Пример #42
0
 public HubOrdBatch CostcoHubOrdBatch(string fileName, IAppSettingsService appSettings, IFileService fileSrvc)
 {
     OrderMessageBatch orderBatch = fileSrvc.CostcoMessageBatchOrder(fileName, appSettings);
     HubOrdBatch batch = new HubOrdBatch(fileName, orderBatch);
     return batch;
 }
Пример #43
0
 public OrderMessageBatch CostcoMessageBatchOrder(string fileName, IAppSettingsService appSettings)
 {
     string filePath = Path.Combine(appSettings.Costco.Dir.Decrypt.Orders.Path, fileName);
     return OrderMessageBatch.Deserialize(filePath);
 }
Пример #44
0
        public FileInfo SaveCostcoConfirm(ConfirmMessageBatch confirmBatch, IAppSettingsService appSettings)
        {
            string saveFilePath = Path.Combine(appSettings.Costco.Dir.Decrypt.Confirms.Path, confirmBatch.FileName);
            confirmBatch.ValidateXml();
            confirmBatch.SaveFile(saveFilePath);

            return new FileInfo(saveFilePath);
        }
Пример #45
0
 public FileInfo CostcoEncryptFileOrder(string fileName, IAppSettingsService appSettings)
 {
     string fileSpec = appSettings.Costco.Dir.Encrypt.Orders.FileSpec(fileName);
     return new FileInfo(fileSpec);
 }
Пример #46
0
 public FileInfo CostcoDecryptFileConfirm(string fileName, IAppSettingsService appSettings)
 {
     string fileSpec = appSettings.Costco.Dir.Decrypt.Confirms.FileSpec(fileName);
     return new FileInfo(fileSpec);
 }
Пример #47
0
        public FileInfo SaveCostcoFA(FAMessageBatch faBatch, IAppSettingsService appSettings)
        {
            string saveFilePath = Path.Combine(appSettings.Costco.Dir.Decrypt.FAs.Path, faBatch.FileName);
            faBatch.ValidateXml();
            faBatch.SaveFile(saveFilePath);

            return new FileInfo(saveFilePath);
        }
Пример #48
0
        public FileInfo EncryptCostcoFAFile(string decryptedFilePath, IAppSettingsService appSettings)
        {
            string encryptedFileName = GnuPG.EncryptFile(decryptedFilePath, appSettings.Costco.Dir.Encrypt.FAs.Path);

            return new FileInfo(encryptedFileName);
        }
Пример #49
0
 public FileInfo[] CostcoEncryptFilesOrder(IAppSettingsService appSettings)
 {
     return CostcoEncryptFiles(appSettings.Costco.Dir.Encrypt.Orders.Path);
 }
 public AppSettingsViewModel(IAppSettingsService appSettingsService, IGlobalizationService globalizationService, IStyleService styleService)
 {
     this.appSettingsService = appSettingsService;
     this.globalizationService = globalizationService;
     this.styleService = styleService;
 }
Пример #51
0
 public HubFABatch CostcoHubFABatch(string fileName, IAppSettingsService appSettings, IFileService fileSrvc)
 {
     FAMessageBatch faBatch = fileSrvc.CostcoMessageBatchFA(fileName, appSettings);
     HubFABatch batch = new HubFABatch(fileName, faBatch);
     return batch;
 }
Пример #52
0
 public FileLogService(IAppSettingsService appSettingsService)
 {
     _appSettingsService = appSettingsService;
 }
Пример #53
0
        public IEnumerable<IDecryptFile> CostcoReadFilesOrder(IAppSettingsService appSettings)
        {
            FileInfo[] decryptedFiles = this.CostcoDecryptFilesOrder(appSettings);
            FileInfo[] encryptedFiles = this.CostcoEncryptFilesOrder(appSettings);

            IEnumerable<IDecryptFile> files = DecryptFile.FilesFromFileInfos(decryptedFiles, encryptedFiles);
            return files;
        }
Пример #54
0
 public FileInfo[] CostcoDecryptFilesFA(IAppSettingsService appSettings)
 {
     return CostcoDecryptFiles(appSettings.Costco.Dir.Decrypt.FAs.Path);
 }
Пример #55
0
 public HubConfBatch CostcoHubConfBatch(string fileName, IAppSettingsService appSettings, IFileService fileSrvc)
 {
     ConfirmMessageBatch confirmBatch = fileSrvc.CostcoMessageBatchConfirm(fileName, appSettings);
     HubConfBatch batch = new HubConfBatch(fileName, confirmBatch);
     return batch;
 }
 public LibGuideService(ISimpleWebRequestService simpleWebRequestService, IAppSettingsService appSettingsService)
 {
     _simpleWebRequestService = simpleWebRequestService;
     _appSettingsService = appSettingsService;
 }
Пример #57
0
 public CcDownloadController(IAppSettingsService appSettingsService, ICHFtpService chFtpService, IGnuPGService gnuPGService)
 {
     appSettings = appSettingsService;
     chFtp = chFtpService;
     gnuPG = gnuPGService;
 }
Пример #58
0
        public FileInfo DecryptCostcoOrderFile(string encryptedFilePath, IAppSettingsService appSettings)
        {
            string decryptedFileName = GnuPG.DecryptFile(encryptedFilePath, appSettings.Costco.Dir.Decrypt.Orders.Path, CostcoDecryptExt);

            return new FileInfo(decryptedFileName);
        }
Пример #59
0
 public FileInfo[] CostcoEncryptFilesConfirm(IAppSettingsService appSettings)
 {
     return CostcoEncryptFiles(appSettings.Costco.Dir.Encrypt.Confirms.Path);
 }
Пример #60
0
 public ConfirmMessageBatch CostcoMessageBatchConfirm(string fileName, IAppSettingsService appSettings)
 {
     string filePath = Path.Combine(appSettings.Costco.Dir.Decrypt.Confirms.Path, fileName);
     return ConfirmMessageBatch.Deserialize(filePath);
 }