コード例 #1
0
 public BackupWorkflow(IConsoleService consoleService, IProgressService progressService,
                       IStorageService storageService)
 {
     _consoleService  = consoleService;
     _storageService  = storageService;
     _progressService = progressService;
 }
コード例 #2
0
        public LocalSourceViewModel(
            IChocolateyService chocolateyService,
            IProgressService progressService,
            IPersistenceService persistenceService,
            IConfigService configService,
            IEventAggregator eventAggregator,
            string displayName,
            IMapper mapper)
        {
            _chocolateyService  = chocolateyService;
            _progressService    = progressService;
            _persistenceService = persistenceService;
            _configService      = configService;

            DisplayName = displayName;

            _packages            = new List <IPackageViewModel>();
            Packages             = new ObservableCollection <IPackageViewModel>();
            PackageSource        = CollectionViewSource.GetDefaultView(Packages);
            PackageSource.Filter = FilterPackage;

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

            _eventAggregator = eventAggregator;
            _mapper          = mapper;
            _eventAggregator.Subscribe(this);
        }
コード例 #3
0
 public PostPageViewModel(IUxService uxService, INavigationService navigationService, IServiceBroker serviceBroker, IEventAggregator eventAggregator, IProgressService progressService, IWindowManager windowManager)
     : base(progressService, windowManager, navigationService)
 {
     this._uxService = uxService;
     this._serviceBroker = serviceBroker;
     this.Photos = new ObservableCollection<Models.Ui.ItemWithUrl>();
 }
コード例 #4
0
 public ContractorViewModel()
 {
     this.contractorDataService = new ContractorDataService();
     progressService            = DependencyService.Get <IProgressService> ();
     db             = new ContractorDatabase();
     contractorList = new ObservableCollection <Contractor>();
 }
コード例 #5
0
        public CancellationToken Start(IServiceContainer services, JsonRpc rpc)
        {
            _ui        = services.GetService <IUIService>();
            _telemetry = services.GetService <ITelemetryService>();
            _progress  = services.GetService <IProgressService>();

            _rpc = rpc;

            _server.OnLogMessage           += OnLogMessage;
            _server.OnShowMessage          += OnShowMessage;
            _server.OnTelemetry            += OnTelemetry;
            _server.OnPublishDiagnostics   += OnPublishDiagnostics;
            _server.OnApplyWorkspaceEdit   += OnApplyWorkspaceEdit;
            _server.OnRegisterCapability   += OnRegisterCapability;
            _server.OnUnregisterCapability += OnUnregisterCapability;
            _server.OnAnalysisQueued       += OnAnalysisQueued;
            _server.OnAnalysisComplete     += OnAnalysisComplete;

            _disposables
            .Add(() => _server.OnLogMessage           -= OnLogMessage)
            .Add(() => _server.OnShowMessage          -= OnShowMessage)
            .Add(() => _server.OnTelemetry            -= OnTelemetry)
            .Add(() => _server.OnPublishDiagnostics   -= OnPublishDiagnostics)
            .Add(() => _server.OnApplyWorkspaceEdit   -= OnApplyWorkspaceEdit)
            .Add(() => _server.OnRegisterCapability   -= OnRegisterCapability)
            .Add(() => _server.OnUnregisterCapability -= OnUnregisterCapability)
            .Add(() => _server.OnAnalysisQueued       -= OnAnalysisQueued)
            .Add(() => _server.OnAnalysisComplete     -= OnAnalysisComplete);

            return(_sessionTokenSource.Token);
        }
コード例 #6
0
 public ProgressViewModel(IProgressService progressService)
 {
     progressService.OnStart  += progressServiceOnStart;
     progressService.OnUpdate += progressServiceOnUpdate;
     progressService.OnStop   += progressServiceOnStop;
     this.IsVisible            = false;
 }
コード例 #7
0
 public CommitsService(
     IMessage message,
     IRepositoryCommands repositoryCommands,
     Func <SetBranchPromptDialog> setBranchPromptDialogProvider,
     IGitCommitBranchNameService gitCommitBranchNameService,
     IDiffService diffService,
     ILinkService linkService,
     IRepositoryMgr repositoryMgr,
     IProgressService progressService,
     IStatusService statusService,
     IGitCommitService gitCommitService,
     IGitStatusService gitStatusService,
     Func <
         BranchName,
         IEnumerable <CommitFile>,
         string,
         bool,
         CommitDialog> commitDialogProvider)
 {
     this.commitDialogProvider = commitDialogProvider;
     this.gitCommitService     = gitCommitService;
     this.gitStatusService     = gitStatusService;
     this.message                       = message;
     this.repositoryCommands            = repositoryCommands;
     this.setBranchPromptDialogProvider = setBranchPromptDialogProvider;
     this.gitCommitBranchNameService    = gitCommitBranchNameService;
     this.diffService                   = diffService;
     this.linkService                   = linkService;
     this.repositoryMgr                 = repositoryMgr;
     this.progress                      = progressService;
     this.statusService                 = statusService;
 }
コード例 #8
0
        public ShellView(
            IDialogService dialogService,
            IProgressService progressService,
            IChocolateyConfigurationProvider chocolateyConfigurationProvider,
            IConfigService configService,
            IFileSystem fileSystem,
            IImageService imageService)
        {
            InitializeComponent();

            dialogService.ShellView   = this;
            progressService.ShellView = this;

            _progressService = progressService;
            _chocolateyConfigurationProvider = chocolateyConfigurationProvider;
            _configService = configService;
            _fileSystem    = fileSystem;
            _imageService  = imageService;

            this.Icon = BitmapFrame.Create(_imageService.ToolbarIconUri);

            CheckOperatingSystemCompatibility();

            // Certain things like Cef (our markdown browser engine) get unhappy when GUI is started from a different cwd.
            // If we're in a different one, reset it to our app files directory.
            if (_fileSystem.get_directory_name(Environment.CurrentDirectory) != Bootstrapper.ApplicationFilesPath)
            {
                Environment.CurrentDirectory = Bootstrapper.ApplicationFilesPath;
            }
        }
コード例 #9
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IExpenseRepository expenseRepository, IProgressService progressService, INavigationService navigationService)
        {
            _expenseRepository = expenseRepository;
            _progressService   = progressService;
            _navigationService = navigationService;

            _refreshCommand    = new RelayCommand(Refresh, () => CanRefresh);
            _addExpenseCommand = new RelayCommand(AddExpense, () => CanAddExpense);
            _removeExpense     = new RelayCommand <ExpenseModel>(RemoveExpense);
            _save = new RelayCommand <ExpenseModel>(Save);

            if (IsInDesignMode)
            {
                ExpenseCollections = expenseRepository.GetExampleCollections();
                ActiveCollection   = ExpenseCollections[0];

                NewExpenseDescription = "my description is longer than the place avaliable";
                NewExpenseAmount      = 5.2;
                NewExpenseDate        = DateTime.Now;
            }
            else
            {
                Initialize();
                SetExpenseDefaults();
            }
            _removeExpenseCollection     = new RelayCommand <ExpenseCollectionModel>(RemoveExpenseCollection, CanRemoveExpenseCollection);
            _saveExpenseCollection       = new RelayCommand <ExpenseCollectionModel>(SaveExpenseCollection, CanSaveExpenseCollection);
            _addExpenseCollectionCommand = new RelayCommand(AddExpenseCollection, () => CanAddExpenseCollection);
            _useExpenseAsTemplateCommand = new RelayCommand <ExpenseModel>(UseExpenseAsTemplate);

            Messenger.Default.Register <ExpenseCollectionModel>(this, Messages.Select, EvaluateSelectMessage);
        }
コード例 #10
0
ファイル: GitHubService.cs プロジェクト: famoser/archive
 public GitHubService(IConsoleService consoleService, IProgressService progressService, Dictionary <string, string> configuredKeyValues) : base(new Dictionary <string, string>()
 {
     { GitHubUsername, "GitHub username" },
     { GitHubPassword, "GitHub password" }
 }, consoleService, progressService, configuredKeyValues)
 {
 }
コード例 #11
0
        internal MainWindowViewModel(
            ModelMetadata modelMetadata,
            ILatestVersionService latestVersionService,
            IMainWindowService mainWindowService,
            ModelViewModel modelViewModel,
            OpenModelViewModel openModelViewModel,
            IOpenModelService openModelService,
            IRecentModelsService recentModelsService,
            IModelMetadataService modelMetadataService,
            IStartInstanceService startInstanceService,
            IModelViewService modelViewService,
            IProgressService progress)
        {
            this.modelMetadata = modelMetadata;

            this.mainWindowService    = mainWindowService;
            this.openModelService     = openModelService;
            this.recentModelsService  = recentModelsService;
            this.modelMetadataService = modelMetadataService;
            this.startInstanceService = startInstanceService;
            this.modelViewService     = modelViewService;
            this.progress             = progress;

            ModelViewModel     = modelViewModel;
            OpenModelViewModel = openModelViewModel;

            modelMetadata.OnChange += (s, e) => Notify(nameof(MainTitle));
            latestVersionService.OnNewVersionAvailable += (s, e) => IsNewVersionVisible = true;
            latestVersionService.StartCheckForLatestVersion();
            SearchItems = new ObservableCollection <SearchEntry>();
            ClearSelectionItems();
        }
コード例 #12
0
        internal CodeDialog(
            Lazy <IModelNotifications> modelNotifications,
            ISolutionService solutionService,
            IProgressService progressService,
            ModelMetadata modelMetadata,
            WindowOwner owner,
            NodeName nodeName,
            Source source,
            Func <Task <M <Source> > > updateSource)
        {
            this.modelNotifications = modelNotifications;

            this.source       = source;
            this.updateSource = updateSource;

            Owner = owner;
            InitializeComponent();
            Loaded += Window_Loaded;

            codeViewModel = new CodeViewModel(solutionService, progressService, modelMetadata.ModelPaths, nodeName.DisplayLongName, this);
            DataContext   = codeViewModel;

            SetSyntaxHighlighting();

            SetCodeText();

            modelNotifications.Value.ModelUpdated += OnModelUpdated;
        }
コード例 #13
0
        public RemoteSourceViewModel(
            IChocolateyService chocolateyPackageService,
            IProgressService progressService,
            IConfigService configService,
            IEventAggregator eventAggregator,
            ChocolateySource source,
            IMapper mapper)
        {
            Source = source;
            _chocolateyPackageService = chocolateyPackageService;
            _progressService          = progressService;
            _configService            = configService;
            _eventAggregator          = eventAggregator;
            _mapper = mapper;

            ListViewMode = _configService.GetSettings().DefaultToTileViewForLocalSource ? ListViewMode.Tile : ListViewMode.Standard;

            Packages    = new ObservableCollection <IPackageViewModel>();
            DisplayName = source.Id;

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

            _eventAggregator.Subscribe(this);
        }
コード例 #14
0
        public SettingsViewModel(
            IChocolateyService chocolateyService,
            IDialogService dialogService,
            IProgressService progressService,
            IConfigService configService,
            IEventAggregator eventAggregator,
            IChocolateyGuiCacheService chocolateyGuiCacheService,
            IFileSystem fileSystem,
            TranslationSource translationSource)
            : base(translationSource)
        {
            _chocolateyService         = chocolateyService;
            _dialogService             = dialogService;
            _progressService           = progressService;
            _configService             = configService;
            _eventAggregator           = eventAggregator;
            _chocolateyGuiCacheService = chocolateyGuiCacheService;
            _fileSystem        = fileSystem;
            _translationSource = translationSource;
            DisplayName        = L(nameof(Resources.SettingsViewModel_DisplayName));
            Activated         += OnActivated;
            Deactivated       += OnDeactivated;

            ChocolateyGuiFeaturesView.Filter = new Predicate <object>(o => FilterChocolateyGuiFeatures(o as ChocolateyGuiFeature));
            ChocolateyGuiSettingsView.Filter = new Predicate <object>(o => FilterChocolateyGuiSettings(o as ChocolateyGuiSetting));
            ChocolateyFeaturesView.Filter    = new Predicate <object>(o => FilterChocolateyFeatures(o as ChocolateyFeature));
            ChocolateySettingsView.Filter    = new Predicate <object>(o => FilterChocolateySettings(o as ChocolateySetting));
        }
コード例 #15
0
 public BranchService(
     IGitFetchService gitFetchService,
     IGitPushService gitPushService,
     IGitBranchService gitBranchService,
     IGitMergeService gitMergeService,
     IGitCommitService gitCommitService,
     IGitCheckoutService gitCheckoutService,
     ICommitsService commitsService,
     IProgressService progressService,
     IMessage message,
     WindowOwner owner,
     IRepositoryCommands repositoryCommands,
     Lazy <IRepositoryService> repositoryService,
     IStatusService statusService)
 {
     this.gitFetchService    = gitFetchService;
     this.gitPushService     = gitPushService;
     this.gitBranchService   = gitBranchService;
     this.gitMergeService    = gitMergeService;
     this.gitCommitService   = gitCommitService;
     this.gitCheckoutService = gitCheckoutService;
     this.commitsService     = commitsService;
     this.progress           = progressService;
     this.message            = message;
     this.owner = owner;
     this.repositoryCommands = repositoryCommands;
     this.repositoryService  = repositoryService;
     this.statusService      = statusService;
 }
コード例 #16
0
        public ConsoleFunctions(
            ILoggerService loggerService,
            IHashService hashService,
            IProgressService <double> progress,
            Red4ParserService wolvenkitFileService,
            ModTools modTools,

            IOptions <CommonImportArgs> commonImportArgs,
            IOptions <XbmImportArgs> xbmImportArgs,
            IOptions <MeshImportArgs> meshImportArgs,
            IOptions <XbmExportArgs> xbmExportArgs,
            IOptions <MeshExportArgs> meshExportArgs,
            IOptions <MorphTargetExportArgs> morphTargetExportArgs,
            IOptions <MlmaskExportArgs> mlmaskExportArgs,
            IOptions <WemExportArgs> wemExportArgs
            )
        {
            _loggerService   = loggerService;
            _modTools        = modTools;
            _progressService = progress;
            _hashService     = hashService;

            _commonImportArgs      = commonImportArgs;
            _xbmImportArgs         = xbmImportArgs;
            _meshImportArgs        = meshImportArgs;
            _wolvenkitFileService  = wolvenkitFileService;
            _xbmExportArgs         = xbmExportArgs;
            _meshExportArgs        = meshExportArgs;
            _morphTargetExportArgs = morphTargetExportArgs;
            _mlmaskExportArgs      = mlmaskExportArgs;
            _wemExportArgs         = wemExportArgs;
        }
コード例 #17
0
 public FolderService(IConsoleService consoleService, IProgressService progressService, Dictionary <string, string> configuredKeyValues) : base(new Dictionary <string, string>()
 {
     { Folder, "Folder" },
     { Zipping, "Zip Folder (enter y if you want the folder to be zipped)" }
 }, consoleService, progressService, configuredKeyValues)
 {
 }
コード例 #18
0
ファイル: RemoteSourceViewModel.cs プロジェクト: tapika/swupd
        public RemoteSourceViewModel(
            IChocolateyService chocolateyPackageService,
            IDialogService dialogService,
            IProgressService progressService,
            IChocolateyGuiCacheService chocolateyGuiCacheService,
            IConfigService configService,
            IEventAggregator eventAggregator,
            ChocolateySource source,
            IMapper mapper)
        {
            Source = source;
            _chocolateyPackageService  = chocolateyPackageService;
            _dialogService             = dialogService;
            _progressService           = progressService;
            _chocolateyGuiCacheService = chocolateyGuiCacheService;
            _configService             = configService;
            _eventAggregator           = eventAggregator;
            _mapper = mapper;

            Packages    = new ObservableCollection <IPackageViewModel>();
            DisplayName = source.Id;

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

            _eventAggregator.Subscribe(this);
        }
コード例 #19
0
 public RecordingViewModel(
     ITivoConnectionService connectionService,
     IProgressService progressService)
 {
     this.connectionService = connectionService;
     this.progressService   = progressService;
 }
コード例 #20
0
        public SearchViewModel(
            IProgressService progressService,
            ISpeechService speechService,
            ITivoConnectionService connectionService,
            Func <PersonItemViewModel> personFactory,
            Func <CollectionItemViewModel> collectionFactory
            )
        {
            this.connectionService = connectionService;
            this.progressService   = progressService;
            this.speechService     = speechService;

            this.personFactory     = personFactory;
            this.collectionFactory = collectionFactory;

            this.connectionService.PropertyChanged += OnConnectionServicePropertyChanged;

            this.searchTextChangedSubject
            .Throttle(TimeSpan.FromSeconds(1))
            .Subscribe(_ =>
            {
                if (this.SearchText != this.lastSearchText)
                {
                    this.Search();
                }
            });
        }
コード例 #21
0
        public void SetUp()
        {
            courseDataService   = A.Fake <ICourseDataService>();
            progressDataService = A.Fake <IProgressDataService>();

            progressService = new ProgressService(courseDataService, progressDataService);
        }
コード例 #22
0
        public ShellView(
            IProgressService progressService,
            IChocolateyConfigurationProvider chocolateyConfigurationProvider,
            IConfigService configService)
        {
            InitializeComponent();

            var service = progressService as ProgressService;

            if (service != null)
            {
                service.ShellView = this;
            }

            _progressService = progressService;
            _chocolateyConfigurationProvider = chocolateyConfigurationProvider;
            _configService = configService;

            CheckOperatingSystemCompatibility();

            // Certain things like Cef (our markdown browser engine) get unhappy when GUI is started from a different cwd.
            // If we're in a different one, reset it to our app files directory.
            if (Path.GetDirectoryName(Environment.CurrentDirectory) != Bootstrapper.ApplicationFilesPath)
            {
                Environment.CurrentDirectory = Bootstrapper.ApplicationFilesPath;
            }
        }
コード例 #23
0
ファイル: ConfigureService.cs プロジェクト: famoser/archive
 protected ConfigureService(Dictionary <string, string> allKeyValues, IConsoleService consoleService, IProgressService progressService, Dictionary <string, string> configuredKeyValues)
 {
     AllKeyValues        = allKeyValues;
     ConsoleService      = consoleService;
     ProgressService     = progressService;
     ConfiguredKeyValues = configuredKeyValues;
 }
コード例 #24
0
 public FolderEditorViewModel(IApi api, IProgressService progressService) : base(api, progressService)
 {
     Rules = new Dictionary <string, Func <bool> >
     {
         [nameof(Name)]          = () => !string.IsNullOrWhiteSpace(Name),
         [nameof(SelectedColor)] = () => SelectedColor != null,
     };
 }
コード例 #25
0
        public ChangeCardLabelsViewModel(object root) : base(root)
        {
            _eventAggregator = IoC.Get<IEventAggregator>();
            _api = IoC.Get<ITrello>();
            _progress = IoC.Get<IProgressService>();

            Labels = new BindableCollection<Label>();
        }
コード例 #26
0
        public ChangeCardLabelsViewModel(object root) : base(root)
        {
            _eventAggregator = IoC.Get <IEventAggregator>();
            _api             = IoC.Get <ITrello>();
            _progress        = IoC.Get <IProgressService>();

            Labels = new BindableCollection <Label>();
        }
コード例 #27
0
        public AmendDetailsPage()
        {
            dataService     = new DataService();
            progressService = DependencyService.Get <IProgressService> ();
            var layout = this.AssignValues();

            this.Content = layout;
        }
コード例 #28
0
 protected BaseViewModel(ILoader loader, IProgressService progressService,
     INavigationService navigationService)
 {
     Loader = loader;
     Loader.LoadingChanged += (sender, args) => IsLoadingChanged(Loader.IsLoading);
     _progressService = progressService;
     NavigationService = navigationService;
 }
コード例 #29
0
 public IssueDetailsPageViewModel(IDeviceService deviceService,
     ILoader loader,
     IProgressService progressService,
     INavigationService navigationService)
     : base(loader, progressService, navigationService)
 {
     _deviceService = deviceService;
 }
コード例 #30
0
ファイル: AbstractHandler.cs プロジェクト: Bunk/trellow
        protected AbstractHandler(IEventAggregator events, ITrello api, IProgressService progress)
        {
            Api = api;
            Progress = progress;

            Events = events;
            Events.Subscribe(this);
        }
コード例 #31
0
 public AgentViewModel(INavigation navigation, ILoginManager ilm)
 {
     this.navigation    = navigation;
     this.dataService   = new DataService();
     this.uploadService = new UploadService();
     progressService    = DependencyService.Get <IProgressService> ();
     this.ilm           = ilm;
 }
コード例 #32
0
 public ThinkViewModelBase(IProgressService progressService, IWindowManager windowManager, INavigationService navigationService)
 {
     this._progressService = progressService;
     this._windowManager = windowManager;
     // this._eventAggregator.Subscribe(this);
     this._navigationService = navigationService;
     // this.eventAggregator = eventAggregator;
 }
コード例 #33
0
 public ProgressController(
     IProgressService progressService,
     ILogger <ProgressController> logger
     )
 {
     _progressService = progressService;
     _logger          = logger;
 }
コード例 #34
0
ファイル: LogViewModel.cs プロジェクト: kosorin/onedo-uwp
 public LogViewModel(IProgressService progressService)
 {
     ProgressService        = progressService;
     LoadCommand            = new AsyncRelayCommand(Load);
     ExportCommand          = new AsyncRelayCommand(Export);
     CopyToClipboardCommand = new RelayCommand(CopyToClipboard);
     ClearCommand           = new AsyncRelayCommand(Clear);
 }
コード例 #35
0
 public PackageService(IProgressService progressService, ISourceService sourceService,
                       Func <IPackageViewModel> packageFactory, Func <Type, ILogService> logFunc)
 {
     _progressService = progressService;
     _sourceService   = sourceService;
     _packageFactory  = packageFactory;
     _logService      = logFunc(typeof(PackageService));
 }
コード例 #36
0
 public void Setup()
 {
     courseDataService  = A.Fake <ICourseDataService>();
     progressService    = A.Fake <IProgressService>();
     sessionDataService = A.Fake <ISessionDataService>();
     logger             = A.Fake <ILogger <StoreAspService> >();
     storeAspService    = new StoreAspService(progressService, sessionDataService, courseDataService, logger);
 }
コード例 #37
0
        public MainWindow()
        {
            InitializeComponent();

            // Startup code
            // Instead of using a func here, using Cherry.IoC to retrieve a IProgressService 
            // and registering this as IProgressDisplay in the IoC container would work as well
            _progressService = new CherryProgressService(() => this);
        }
コード例 #38
0
        public IssueListPageViewModel(ILoader loader, ILoader listLoader, IProgressService progressService,
            INavigationService navigationService,
            IIssueService issueService)
            : base(loader, listLoader, progressService, navigationService)
        {
            _issueService = issueService;

            Title = IssueList.Title;
        }
コード例 #39
0
 public AboutPageViewModel(IDeviceService deviceService,
     ILoader loader,
     IProgressService progressService,
     INavigationService navigationService)
     : base(loader, progressService, navigationService)
 {
     _deviceService = deviceService;
     Version = "1.0";
 }
コード例 #40
0
ファイル: ServiceFactory.cs プロジェクト: hjlfmy/Rubezh
 public static void Initialize(ILayoutService ILayoutService, IProgressService IProgressService, IValidationService IValidationService)
 {
     SaveService = new SaveService();
     Events = new EventAggregator();
     ResourceService = new ResourceService();
     Layout = ILayoutService;
     ProgressService = IProgressService;
     ValidationService = IValidationService;
     LoginService = new LoginService(ClientType.Administrator, "Администратор. Авторизация");
 }
コード例 #41
0
 /// <summary>
 /// Initializes a new instance of the ViewModelWorker class
 /// </summary>
 /// <param name="navigationService">NavigationService provided by Caliburn.Micro</param>
 /// <param name="progressService">ProgressService provided by Caliburn.Micro</param>
 /// <param name="eventAggregator">EventAggregator provided by Caliburn.Micro</param>
 /// <param name="storageService">StorageService provided by Caliburn.Micro</param>
 /// <param name="navigationHelperService">NavigationHelperService provided by Caliburn.Micro</param>
 /// <param name="ratingService">RatingService provided by Caliburn.Micro</param>
 /// <param name="diagnosticsService">DiagnosticsService provided by Caliburn.Micro</param>
 public ViewModelWorker(INavigationService navigationService, IProgressService progressService, IEventAggregator eventAggregator, IStorageService storageService, INavigationHelperService navigationHelperService, IRatingService ratingService, IDiagnosticsService diagnosticsService)
 {
     this.navigationService = navigationService;
     this.progressService = progressService;
     this.eventAggregator = eventAggregator;
     this.storageService = storageService;
     this.navigationHelperService = navigationHelperService;
     this.ratingService = ratingService;
     this.diagnosticsService = diagnosticsService;
 }
コード例 #42
0
        public LogWorkPageViewModel(ILoader loader,
            IProgressService progressService,
            INavigationService navigationService,
            IWorkLogService workLogService)
            : base(loader, progressService, navigationService)
        {
            _workLogService = workLogService;

            Title = LogWork.Title;
            Date = DateTime.Now;
        }
コード例 #43
0
        public RepoListPageViewModel(ILoader loader,
            ILoader listLoader,
            IProgressService progressService,
            INavigationService navigationService,
            IRepoService repoService)
            : base(loader, listLoader, progressService, navigationService)
        {
            _repoService = repoService;

            Title = RepoList.Title;
        }
コード例 #44
0
 public LoginPageViewModel(ILoader loader,
     IProgressService progressService,
     INavigationService navigationService,
     ILoginService loginService,
     IEventAggregator eventAggregator)
     : base(loader, progressService, navigationService)
 {
     Loader.LoadingChanged += (sender, args) => LoginCommand.RaiseCanExecuteChanged();
     _loginService = loginService;
     _eventAggregator = eventAggregator;
 }
コード例 #45
0
ファイル: ProgressTests.cs プロジェクト: ChristianEder/Cherry
 public void BeforeEachTest()
 {
     if (_registry != null)
     {
         _registry.Dispose();
     }
     _registry = new CherryServiceLocatorAndRegistry();
     _progressService = null;
     _progressService = CreateProgressService(_registry);
     Assert.IsNotNull(_progressService, "Please implement the method CreateProgressService()");
 }
コード例 #46
0
        public MoveCardToBoardViewModel(object root) : base(root)
        {
            _eventAggregator = IoC.Get<IEventAggregator>();
            _api = IoC.Get<ITrello>();
            _progress = IoC.Get<IProgressService>();

            Boards = new BindableCollection<Board>();
            Lists = new BindableCollection<List>();

            PropertyChanged += OnPropertyChanged;
        }
コード例 #47
0
        public WorkLogsPageViewModel(ILoader loader,
            ILoader listLoader,
            IProgressService progressService,
            INavigationService navigationService,
            IWorkLogService workLogService)
            : base(loader, listLoader, progressService, navigationService)
        {
            _workLogService = workLogService;

            Title = Resources.Strings.WorkLogs.Title;
        }
コード例 #48
0
        public ImageDownloadService(IPlatformCodeService platformCodeService, ISqliteService sqliteService, IPermissionsService permissionsService, IProgressService progressService)
        {
            _platformCodeService = platformCodeService;
            _permissionsService = permissionsService;
            _progressService = progressService;

            _maxHeight = _platformCodeService.DeviceHeight();
            _maxWidth = _platformCodeService.DeviceWidth();

            _genericRepository = new GenericRepository<ImageContentModel, ImageContentEntity>(sqliteService);
        }
コード例 #49
0
        public MyDayViewModel(IWeatherRepository weatherRepository, IProgressService progressService)
        {
            _weatherRepository = weatherRepository;

            _refreshCommand = new LoadingRelayCommand(Refresh);

            Forecasts = _weatherRepository.GetForecasts();
            if (!IsInDesignMode)
            {
                if (_refreshCommand.CanExecute(null))
                    _refreshCommand.Execute(null);
            }
        }
コード例 #50
0
        public CategoriesPageViewModel(INavigationService navigationService,
            IEventAggregator eventAggregator,
            IServiceBroker serviceBroker,
            IProgressService progressService,
            IWindowManager windowManager)
        {
            this._serviceBroker = serviceBroker;
            this._navigationService = navigationService;
            this._eventAggregator = eventAggregator;
            this._progressService = progressService;
            this._windowManager = windowManager;

            this.Items = new ObservableCollection<Models.Ui.HomeItem>();
        }
コード例 #51
0
        public MainWindowViewModel(ISourceService sourceService, IProgressService progressService, Lazy<IPackageService> packageServiceLazy, IVersionNumberProvider versionNumberProvider)
        {
            if (sourceService == null)
            {
                throw new ArgumentNullException("sourceService");
            }

            this._sourceService = sourceService;
            this._progressService = progressService;
            this._packageService = packageServiceLazy;
            this._versionNumberProvider = versionNumberProvider;
            this.Sources = new ObservableCollection<SourceViewModel>(this._sourceService.GetSources());

            SourcesChangedEventManager.AddListener(sourceService, this);
        }
コード例 #52
0
 public ViewerPageViewModel(IProgressService progressService,
     IWindowManager windowManager,
     INavigationService navigationService,
     IUxService uiService)
     : base(progressService, windowManager, navigationService)
 {
     this._uiService = uiService;
     if (AppBase.Current.Photos != null)
     {
         foreach (var info in AppBase.Current.Photos)
         {
             this.Photos.Add(info);
         }
     }
 }
コード例 #53
0
        public PackageService(
            IProgressService progressService,
            ISourceService sourceService,
            Func<IPackageViewModel> packageFactory,
            Func<Type, ILogService> logFunc)
        {
            if (logFunc == null)
            {
                throw new ArgumentNullException("logFunc");
            }

            this._progressService = progressService;
            this._sourceService = sourceService;
            this._packageFactory = packageFactory;
            this._logService = logFunc(typeof(PackageService));
        }
コード例 #54
0
        protected BasePackageService(IProgressService progressService, Func<Type, ILogService> logServiceFunc, IChocolateyConfigurationProvider chocolateyConfigurationProvider)
        {
            if (logServiceFunc == null)
            {
                throw new ArgumentNullException("logServiceFunc");
            }

            this.GetInstalledLock = new AsyncLock();
            this.progressService = progressService;
            this.logService = logServiceFunc(typeof(IChocolateyPackageService));
            this.chocolateyConfigurationProvider = chocolateyConfigurationProvider;

            this.PackagesJsonPath = Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                "ChocolateyGUI",
                "packages.json");
        }
コード例 #55
0
ファイル: NoteViewModel.cs プロジェクト: famoser/RememberLess
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public NoteViewModel(INoteRepository noteRepository, IHistoryNavigationService navigationService, IProgressService progressService)
        {
            _noteRepository = noteRepository;
            _navigationService = navigationService;
            _progressService = progressService;
            
            _saveNoteCommand = new LoadingRelayCommand(SaveNote, () => CanSaveNote);
            _removeNoteCommand = new LoadingRelayCommand(RemoveNote);

            _removeNoteCommand.AddDependentCommand(_saveNoteCommand);
            _saveNoteCommand.AddDependentCommand(_removeNoteCommand);

            if (IsInDesignMode)
            {
                ActiveNote = noteRepository.GetCollections()[0].CompletedNotes[0];
            }
        }
コード例 #56
0
        public LocalSourceControlViewModel(
            IChocolateyPackageService chocolateyService,
            IProgressService progressService,
            IPersistenceService persistenceService,
            Func<Type, ILogService> logFactory)
        {
            if (logFactory == null)
            {
                throw new ArgumentNullException("logFactory");
            }

            this._chocolateyService = chocolateyService;
            this._progressService = progressService;
            this._persistenceService = persistenceService;
            this._logService = logFactory(typeof(LocalSourceControlViewModel));
            PackagesChangedEventManager.AddListener(this._chocolateyService, this);

            this.Packages = new ObservableCollection<IPackageViewModel>();
            this._packages = new List<IPackageViewModel>();
        }
コード例 #57
0
ファイル: MainViewModel.cs プロジェクト: famoser/RememberLess
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(INoteRepository noteRepository, IProgressService progressService, IHistoryNavigationService navigationService)
        {
            _noteRepository = noteRepository;
            _progressService = progressService;
            _navigationService = navigationService;

            _refreshCommand = new LoadingRelayCommand(Refresh);
            _addNoteCommand = new LoadingRelayCommand(AddNote, () => CanAddNote);
            _removeNote = new LoadingRelayCommand<NoteModel>(RemoveNote);
            _toggleCompleted = new LoadingRelayCommand<NoteModel>(ToggleCompleted);

            NoteCollections = noteRepository.GetCollections();
            NoteCollections.CollectionChanged += NoteCollectionsOnCollectionChanged;
            if (IsInDesignMode)
            {
                ActiveCollection = NoteCollections[0];
            }

            _removeNoteCollection = new LoadingRelayCommand<NoteCollectionModel>(RemoveNoteCollection, CanRemoveNoteCollection);
            _saveNoteCollection = new LoadingRelayCommand<NoteCollectionModel>(SaveNoteCollection, CanSaveNoteCollection);
            _addNoteCollectionCommand = new LoadingRelayCommand(AddNoteCollection, () => CanAddNoteCollection);
            _selectNoteCommand = new RelayCommand<NoteModel>(SelectNote);
        }
コード例 #58
0
        public MainWindow(IMainWindowViewModel viewModel, INavigationService navigationService, IProgressService progressService)
        {
            if (navigationService == null)
            {
                throw new ArgumentNullException("navigationService");
            }

            InitializeComponent();
            DataContext = viewModel;

            if (progressService is ProgressService)
            {
                (progressService as ProgressService).MainWindow = this;
            }

            this._progressService = progressService;
            
            // RichiCoder1 (21-09-2014) - Why are we doing this, especially here?
            AutoMapper.Mapper.CreateMap<V2FeedPackage, PackageViewModel>();
            AutoMapper.Mapper.CreateMap<PackageMetadata, PackageViewModel>();

            navigationService.SetNavigationItem(GlobalFrame);
            navigationService.Navigate(typeof(SourcesControl));
        }
コード例 #59
0
 public CSharpChocolateyPackageService(IProgressService progressService, Func<Type, ILogService> logServiceFunc, IChocolateyConfigurationProvider chocolateyConfigurationProvider)
     : base(progressService, logServiceFunc, chocolateyConfigurationProvider)
 {
     this.chocoExePath = Path.Combine(this.ChocolateyConfigurationProvider.ChocolateyInstall, "choco.exe");
 }
コード例 #60
0
ファイル: CoreViewModel.cs プロジェクト: modulexcite/nvmsharp
        public CoreViewModel()
        {
            _currentAppMode = AppMode.None;
            _initResult = InitResultType.None;
            _userVars = new Dictionary<string, EnVar>();
            _systemVars = new Dictionary<string, EnVar>();
            _modificationMode = ModificationModeType.None;
            _modificationTitle = string.Empty;
            _modifiedKey = string.Empty;
            _modifiedValue = string.Empty;
            _validationMessage = string.Empty;
            _hasUserImportVariables = false;
            _hasSystemImportVariables = false;
            _hasUserExportVariables = false;
            _hasSystemExportVariables = false;
            _hasInitImportStatus = false;
            _hasImportConflicts = false;

            // Get the services
            _messageService = ServiceManager.Instance.GetService<IMessageService>();
            _modificationService = ServiceManager.Instance.GetService<IModificationService>();
            _fileService = ServiceManager.Instance.GetService<IFileService>();
            _progressService = ServiceManager.Instance.GetService<IProgressService>();

            // InitializeEnvironmentVariables the commands
            InitializeCommands();
        }