コード例 #1
0
 public ProfileViewModel(
     IPreferencesService preferencesService,
     LogInControlViewModel loginControlViewModel)
 {
     this.preferencesService = preferencesService;
     LoginControlViewModel   = loginControlViewModel;
 }
コード例 #2
0
        public RestApiBase(Uri baseAddress)
        {
            _requestInterceptors = new List <IRequestInterceptor>();
            _baseAddress         = baseAddress;

            _preferencesService = ServiceLocator.Current.GetInstance <IPreferencesService>();
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LanguagesService" /> class.
 /// </summary>
 /// <param name="localizationManager">The localization manager.</param>
 /// <param name="resourceProvider">The resource provider.</param>
 /// <param name="preferencesService">The preferences service.</param>
 /// <param name="storageProvider">The storage provider.</param>
 /// <param name="mapper">The mapper.</param>
 public LanguagesService(ILocalizationManager localizationManager, IDefaultLocalizationResourceProvider resourceProvider,
                         IPreferencesService preferencesService, IStorageProvider storageProvider, IMapper mapper) : base(storageProvider, mapper)
 {
     this.resourceProvider    = resourceProvider;
     this.preferencesService  = preferencesService;
     this.localizationManager = localizationManager;
 }
コード例 #4
0
ファイル: MainWindowVM.cs プロジェクト: zerohxh/TwitchLeecher
        public MainWindowVM(IKernel kernel,
                            IEventAggregator eventAggregator,
                            ITwitchService twitchService,
                            IDialogService dialogService,
                            INavigationService navigationService,
                            ISearchService searchService,
                            IPreferencesService preferencesService,
                            IRuntimeDataService runtimeDataService,
                            IUpdateService updateService)
        {
            AssemblyUtil au = AssemblyUtil.Get;

            _title = au.GetProductName() + " " + au.GetAssemblyVersion().Trim();

            _kernel             = kernel;
            _eventAggregator    = eventAggregator;
            _twitchService      = twitchService;
            _dialogService      = dialogService;
            _navigationService  = navigationService;
            _searchService      = searchService;
            _preferencesService = preferencesService;
            _runtimeDataService = runtimeDataService;
            _updateService      = updateService;

            _commandLockObject = new object();

            _eventAggregator.GetEvent <ShowViewEvent>().Subscribe(ShowView);
            _eventAggregator.GetEvent <IsAuthorizedChangedEvent>().Subscribe(IsAuthorizedChanged);
            _eventAggregator.GetEvent <PreferencesSavedEvent>().Subscribe(PreferencesSaved);
            _eventAggregator.GetEvent <VideosCountChangedEvent>().Subscribe(VideosCountChanged);
            _eventAggregator.GetEvent <DownloadsCountChangedEvent>().Subscribe(DownloadsCountChanged);

            _showDonationButton = _preferencesService.CurrentPreferences.AppShowDonationButton;
        }
コード例 #5
0
ファイル: RefitService.cs プロジェクト: migueBarrera/MiBocata
 public RefitService(
     IPreferencesService preferenceService,
     IAppSecretsService appSecretsService)
 {
     this.preferenceService = preferenceService;
     this.appSecretsService = appSecretsService;
 }
コード例 #6
0
        public MainWindowVM(IKernel kernel,
                            IEventAggregator eventAggregator,
                            ITwitchService twitchService,
                            IGuiService guiService,
                            IPreferencesService preferencesService,
                            IUpdateService updateService)
        {
            this.mainViews = new Dictionary <Type, ViewModelBase>();

            this.windowState = WindowState.Normal;

            AssemblyUtil au = AssemblyUtil.Get;

            this.title = au.GetProductName() + " " + au.GetAssemblyVersion().Trim();

            this.kernel             = kernel;
            this.eventAggregator    = eventAggregator;
            this.twitchService      = twitchService;
            this.guiService         = guiService;
            this.preferencesService = preferencesService;
            this.updateService      = updateService;

            this.ShowMainView <WelcomeViewVM>();

            this.eventAggregator.GetEvent <SearchBeginEvent>().Subscribe(() => this.ShowMainView <VideosLoadingViewVM>());
            this.eventAggregator.GetEvent <SearchCompleteEvent>().Subscribe(() => this.ShowMainView <VideosViewVM>());
            this.eventAggregator.GetEvent <ShowVideosEvent>().Subscribe(() => this.ShowMainView <VideosViewVM>());
            this.eventAggregator.GetEvent <ShowDownloadsEvent>().Subscribe(() => this.ShowMainView <DownloadsViewVM>());
            this.eventAggregator.GetEvent <ShowPreferencesEvent>().Subscribe(() => this.ShowMainView <PreferencesViewVM>());
            this.eventAggregator.GetEvent <ShowInfoEvent>().Subscribe(() => this.ShowMainView <InfoViewVM>());
            this.eventAggregator.GetEvent <PreferencesSavedEvent>().Subscribe(() => this.PreferencesSaved());
        }
コード例 #7
0
 public ActionResult <WeatherForecast> UpdatePreferences(
     [FromBody] string location,
     [FromServices] IPreferencesService preferences)
 {
     preferences.UpdateLocation(location);
     return(NoContent());
 }
コード例 #8
0
        public SearchResultViewVM(
            IEventAggregator eventAggregator,
            IApiService apiService,
            IAuthService authService,
            IDialogService dialogService,
            INavigationService navigationService,
            IPreferencesService preferencesService,
            ISearchService searchService,
            IFilenameService filenameService)
        {
            _eventAggregator    = eventAggregator;
            _apiService         = apiService;
            _dialogService      = dialogService;
            _navigationService  = navigationService;
            _preferencesService = preferencesService;
            _searchService      = searchService;
            _filenameService    = filenameService;

            _searchService.PropertyChanged += SearchService_PropertyChanged;

            _commandLockObject = new object();

            _eventAggregator.GetEvent <SubOnlyAuthChangedEvent>().Subscribe(SubOnlyAuthChanged);

            _isAuthenticatedSubOnly = authService.IsAuthenticatedSubOnly;
        }
コード例 #9
0
        public TwitchService(
            IPreferencesService preferencesService,
            IProcessingService processingService,
            IRuntimeDataService runtimeDataService,
            IEventAggregator eventAggregator)
        {
            _preferencesService = preferencesService;
            _processingService  = processingService;
            _runtimeDataService = runtimeDataService;
            _eventAggregator    = eventAggregator;

            _videos = new ObservableCollection <TwitchVideo>();
            _videos.CollectionChanged += Videos_CollectionChanged;

            _downloads = new ObservableCollection <TwitchVideoDownload>();
            _downloads.CollectionChanged += Downloads_CollectionChanged;

            _downloadTasks = new ConcurrentDictionary <string, DownloadTask>();

            _appDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            _changeDownloadLockObject = new object();

            _downloadTimer = new Timer(DownloadTimerCallback, null, 0, TIMER_INTERVALL);

            _eventAggregator.GetEvent <RemoveDownloadEvent>().Subscribe(Remove, ThreadOption.UIThread);
        }
コード例 #10
0
        public WelcomeViewVM(
            IPreferencesService preferencesService,
            IPersistenceService persistenceService,
            IDialogService dialogService,
            ITwitchService twitchService)
        {
            _preferencesService = preferencesService;
            _persistenceService = persistenceService;
            _dialogService      = dialogService;
            _twitchService      = twitchService;

            AssemblyUtil au = AssemblyUtil.Get;

            ProductName = au.GetProductName() + " " + au.GetAssemblyVersion().Trim();

            if (_preferencesService.CurrentPreferences.DownloadRememberQueue)
            {
                _persistenceService.GetDownloads();
                if (_persistenceService.Downloads.Count > 0)
                {
                    if (_dialogService.ShowMessageBox("You had downloads from your previous session would you like to resume them?", "Restore previous session?", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                    {
                        foreach (var itm in _persistenceService.Downloads)
                        {
                            _twitchService.Enqueue(itm.DownloadParams, id: itm.Id);
                        }
                    }
                    else
                    {
                        _persistenceService.PurgeDownloads();
                    }
                }
            }
        }
コード例 #11
0
ファイル: TwitchService.cs プロジェクト: dstftw/TwitchLeecher
        public TwitchService(IPreferencesService preferencesService, IEventAggregator eventAggregator)
        {
            if (preferencesService == null)
            {
                throw new ArgumentNullException(nameof(preferencesService));
            }

            if (eventAggregator == null)
            {
                throw new ArgumentNullException(nameof(eventAggregator));
            }

            this.preferencesService = preferencesService;
            this.eventAggregator    = eventAggregator;

            this.videos    = new ObservableCollection <TwitchVideo>();
            this.downloads = new ObservableCollection <TwitchVideoDownload>();

            this.downloadTasks = new ConcurrentDictionary <string, DownloadTask>();

            this.appDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            this.changeDownloadLockObject = new object();

            this.orderMap = new Dictionary <VideoQuality, int>();
            this.orderMap.Add(VideoQuality.Source, 0);
            this.orderMap.Add(VideoQuality.High, 1);
            this.orderMap.Add(VideoQuality.Medium, 2);
            this.orderMap.Add(VideoQuality.Low, 3);
            this.orderMap.Add(VideoQuality.Mobile, 4);

            this.downloadTimer = new Timer(this.DownloadTimerCallback, null, 0, TIMER_INTERVALL);

            this.eventAggregator.GetEvent <DownloadCompletedEvent>().Subscribe(this.Remove, ThreadOption.UIThread);
        }
コード例 #12
0
 public Request(RestApiBase restApiBase, string url, IList <KeyValuePair <string, string> > queryItems)
 {
     _restApiBase        = restApiBase;
     _url                = url;
     _queryItems         = queryItems;
     _preferencesService = App.Container.Resolve <IPreferencesService>();
 }
コード例 #13
0
        public MainWindowVM(IKernel kernel,
                            IEventAggregator eventAggregator,
                            ITwitchService twitchService,
                            IDialogService dialogService,
                            INavigationService navigationService,
                            ISearchService searchService,
                            IPreferencesService preferencesService,
                            IRuntimeDataService runtimeDataService,
                            IUpdateService updateService)
        {
            AssemblyUtil au = AssemblyUtil.Get;

            this.title = au.GetProductName() + " " + au.GetAssemblyVersion().Trim();

            this.kernel             = kernel;
            this.eventAggregator    = eventAggregator;
            this.twitchService      = twitchService;
            this.dialogService      = dialogService;
            this.navigationService  = navigationService;
            this.searchService      = searchService;
            this.preferencesService = preferencesService;
            this.runtimeDataService = runtimeDataService;
            this.updateService      = updateService;

            this.commandLockObject = new object();

            this.eventAggregator.GetEvent <ShowViewEvent>().Subscribe(this.ShowView);
            this.eventAggregator.GetEvent <IsAuthorizedChangedEvent>().Subscribe(this.IsAuthorizedChanged);
            this.eventAggregator.GetEvent <VideosCountChangedEvent>().Subscribe(this.VideosCountChanged);
            this.eventAggregator.GetEvent <DownloadsCountChangedEvent>().Subscribe(this.DownloadsCountChanged);
        }
コード例 #14
0
 public PreferencesController(IPreferencesService iPreferencesService,
                              IEmployeeService iEmployeeService,
                              IMerchantService iMerchantService)
 {
     this.iPreferencesService = iPreferencesService;
     this.iEmployeeService    = iEmployeeService;
     this.iMerchantService    = iMerchantService;
 }
コード例 #15
0
ファイル: UserDataService.cs プロジェクト: su-u/cocoa
 public UserDataService(IHttpDataService httpDataService, ILoggerService loggerService, IPreferencesService preferencesService, ITermsUpdateService termsUpdateService, IExposureNotificationService exposureNotificationService)
 {
     this.httpDataService             = httpDataService;
     this.loggerService               = loggerService;
     this.preferencesService          = preferencesService;
     this.termsUpdateService          = termsUpdateService;
     this.exposureNotificationService = exposureNotificationService;
 }
 public EditPreferencesPresenter(IChildPresenter <IJiraLoginView, IJiraLoginParent> childPresenter,
                                 IPreferencesService preferences, IJiraService jira, IErrorMessageService errors)
 {
     _childPresenter = childPresenter;
     _preferences    = preferences;
     _jira           = jira;
     _errors         = errors;
 }
コード例 #17
0
        public AuthenticationManager(
            IApiFactory apiFactory,
            IPreferencesService preferencesService)
        {
            _preferencesService = preferencesService;

            _authApi = apiFactory.AuthApi;
        }
コード例 #18
0
 public SendEventLogStateRepository(
     IPreferencesService preferencesService,
     ILoggerService loggerService
     )
 {
     _preferencesService = preferencesService;
     _loggerService      = loggerService;
 }
コード例 #19
0
ファイル: Migrator_1_3_0.cs プロジェクト: keiji/cocoa
 public Migrator_1_3_0(
     IPreferencesService preferencesService,
     ILoggerService loggerService
     )
 {
     _preferencesService = preferencesService;
     _loggerService      = loggerService;
 }
コード例 #20
0
        public QuickNoteViewModel(INotesService notesService, IPreferencesService preferencesService)
        {
            _notesService       = notesService;
            _preferencesService = preferencesService;

            fontFamily = _preferencesService.Preferences.NotesFontFamily;
            fontSize   = _preferencesService.Preferences.NotesFontSize;
        }
コード例 #21
0
 string AbsolutePathForKey(IPreferencesService service, string key)
 {
     if (key.StartsWith("/"))
     {
         return(key);
     }
     return(string.Format("{0}/{1}", OwnerString, key));
 }
コード例 #22
0
 public ThumbnailSynchronizer(
     IPreferencesService preferencesService,
     IFileSystemService fileSystemService,
     IMessageHub messageHub)
 {
     _preferencesService = preferencesService;
     _fileSystemService  = fileSystemService;
     _messageHub         = messageHub;
 }
コード例 #23
0
 public LoginViewModelTest()
 {
     //Constructor is called for every test
     _connectivityService   = new Mock <IConnectivityService>().Object;
     _preferencesService    = new Mock <IPreferencesService>().Object;
     _navigationService     = new Mock <INavigationService>().Object;
     _authenticationService = new Mock <IAuthenticationService>().Object;
     _dialogService         = new Mock <IDialogService>().Object;
 }
コード例 #24
0
    public StoreViewModel(
        IPreferencesService preferencesService)
    {
        this.preferencesService = preferencesService;

        ConfigCommand       = new AsyncCommand(() => ConfigCommandAsync());
        ProductsCommand     = new AsyncCommand(() => ProductsCommandAsync());
        CloseSessionCommand = new AsyncCommand(() => CloseSessionCommandAsync());
    }
コード例 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameService" /> class.
 /// </summary>
 /// <param name="messageBus">The message bus.</param>
 /// <param name="reportExportService">The report export service.</param>
 /// <param name="reader">The reader.</param>
 /// <param name="storageProvider">The storage provider.</param>
 /// <param name="preferencesService">The preferences service.</param>
 /// <param name="mapper">The mapper.</param>
 public GameService(IMessageBus messageBus, IReportExportService reportExportService, IReader reader, IStorageProvider storageProvider,
                    IPreferencesService preferencesService, IMapper mapper) : base(storageProvider, mapper)
 {
     this.messageBus          = messageBus;
     this.reportExportService = reportExportService;
     this.preferencesService  = preferencesService;
     this.reader  = reader;
     pathResolver = new PathResolver();
 }
コード例 #26
0
 public NotifyController(IOrderHousePaymentService iOrderHousePaymentService,
                         IPreferencesService iPreferencesService,
                         IOrderPaidService iOrderPaidService)
 {
     this.iOrderHousePaymentService = iOrderHousePaymentService;
     this.iPreferencesService       = iPreferencesService;
     this.iOrderPaidService         = iOrderPaidService;
     logger = LogManager.GetCurrentClassLogger();
 }
コード例 #27
0
        public ExposureNotificationService(ILoggerService loggerService, IHttpClientService httpClientService, ISecureStorageService secureStorageService, IPreferencesService preferencesService, IApplicationPropertyService applicationPropertyService)
        {
            this.loggerService              = loggerService;
            this.httpClientService          = httpClientService;
            this.secureStorageService       = secureStorageService;
            this.preferencesService         = preferencesService;
            this.applicationPropertyService = applicationPropertyService;

            _ = GetExposureNotificationConfig();
        }
コード例 #28
0
ファイル: App.xaml.cs プロジェクト: cyber2370/social-network
        /// <summary>
        /// Инициализирует одноэлементный объект приложения.  Это первая выполняемая строка разрабатываемого
        /// кода; поэтому она является логическим эквивалентом main() или WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending         += OnSuspending;
            this.UnhandledException += OnUnhandledException;

            RegisterDependencies();

            _preferencesService = ServiceLocator.Current.GetInstance <IPreferencesService>();
        }
コード例 #29
0
 public UserDataRepository(
     IPreferencesService preferencesService,
     IDateTimeUtility dateTimeUtility,
     ILoggerService loggerService
     )
 {
     _preferencesService = preferencesService;
     _dateTimeUtility    = dateTimeUtility;
     _loggerService      = loggerService;
 }
コード例 #30
0
        public MainWindowTasksGridViewModel(IEventAggregator eventAggregator, IUnityContainer unityContainer, IPreferencesService preferencesService, ITaskService taskService, IUserService userService)
            : base(eventAggregator, unityContainer, userService)
        {
            this.preferencesService = preferencesService;
            this.taskService        = taskService;
            this.taskSearchCriteria = new TaskSearchCriteria();

            Pagination  = new PaginationViewModel(eventAggregator, preferencesService);
            ProgressBar = new ProgressBarViewModel(eventAggregator, preferencesService);
        }
コード例 #31
0
        public LoginViewModel()
            : base()
        {
            _currentStateService.SetupTextProvider();
            _webService = Mvx.Resolve<IWebService>();
            _preferences = Mvx.Resolve<IPreferencesService>();

            if (!string.IsNullOrEmpty(_preferences.Username) && !string.IsNullOrEmpty(_preferences.Password))
            {
                LogInUser();
            }
        }
コード例 #32
0
 public MenuViewModel()
 {
     _webService = Mvx.Resolve<IWebService>();
     _preferences = Mvx.Resolve<IPreferencesService>();
     LoadMenuData();
 }