public BackupWorkflow(IConsoleService consoleService, IProgressService progressService, IStorageService storageService) { _consoleService = consoleService; _storageService = storageService; _progressService = progressService; }
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); }
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>(); }
public ContractorViewModel() { this.contractorDataService = new ContractorDataService(); progressService = DependencyService.Get <IProgressService> (); db = new ContractorDatabase(); contractorList = new ObservableCollection <Contractor>(); }
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); }
public ProgressViewModel(IProgressService progressService) { progressService.OnStart += progressServiceOnStart; progressService.OnUpdate += progressServiceOnUpdate; progressService.OnStop += progressServiceOnStop; this.IsVisible = false; }
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; }
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; } }
/// <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); }
public GitHubService(IConsoleService consoleService, IProgressService progressService, Dictionary <string, string> configuredKeyValues) : base(new Dictionary <string, string>() { { GitHubUsername, "GitHub username" }, { GitHubPassword, "GitHub password" } }, consoleService, progressService, configuredKeyValues) { }
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(); }
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; }
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); }
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)); }
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; }
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; }
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) { }
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); }
public RecordingViewModel( ITivoConnectionService connectionService, IProgressService progressService) { this.connectionService = connectionService; this.progressService = progressService; }
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(); } }); }
public void SetUp() { courseDataService = A.Fake <ICourseDataService>(); progressDataService = A.Fake <IProgressDataService>(); progressService = new ProgressService(courseDataService, progressDataService); }
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; } }
protected ConfigureService(Dictionary <string, string> allKeyValues, IConsoleService consoleService, IProgressService progressService, Dictionary <string, string> configuredKeyValues) { AllKeyValues = allKeyValues; ConsoleService = consoleService; ProgressService = progressService; ConfiguredKeyValues = configuredKeyValues; }
public FolderEditorViewModel(IApi api, IProgressService progressService) : base(api, progressService) { Rules = new Dictionary <string, Func <bool> > { [nameof(Name)] = () => !string.IsNullOrWhiteSpace(Name), [nameof(SelectedColor)] = () => SelectedColor != null, }; }
public ChangeCardLabelsViewModel(object root) : base(root) { _eventAggregator = IoC.Get<IEventAggregator>(); _api = IoC.Get<ITrello>(); _progress = IoC.Get<IProgressService>(); Labels = new BindableCollection<Label>(); }
public ChangeCardLabelsViewModel(object root) : base(root) { _eventAggregator = IoC.Get <IEventAggregator>(); _api = IoC.Get <ITrello>(); _progress = IoC.Get <IProgressService>(); Labels = new BindableCollection <Label>(); }
public AmendDetailsPage() { dataService = new DataService(); progressService = DependencyService.Get <IProgressService> (); var layout = this.AssignValues(); this.Content = layout; }
protected BaseViewModel(ILoader loader, IProgressService progressService, INavigationService navigationService) { Loader = loader; Loader.LoadingChanged += (sender, args) => IsLoadingChanged(Loader.IsLoading); _progressService = progressService; NavigationService = navigationService; }
public IssueDetailsPageViewModel(IDeviceService deviceService, ILoader loader, IProgressService progressService, INavigationService navigationService) : base(loader, progressService, navigationService) { _deviceService = deviceService; }
protected AbstractHandler(IEventAggregator events, ITrello api, IProgressService progress) { Api = api; Progress = progress; Events = events; Events.Subscribe(this); }
public AgentViewModel(INavigation navigation, ILoginManager ilm) { this.navigation = navigation; this.dataService = new DataService(); this.uploadService = new UploadService(); progressService = DependencyService.Get <IProgressService> (); this.ilm = ilm; }
public ThinkViewModelBase(IProgressService progressService, IWindowManager windowManager, INavigationService navigationService) { this._progressService = progressService; this._windowManager = windowManager; // this._eventAggregator.Subscribe(this); this._navigationService = navigationService; // this.eventAggregator = eventAggregator; }
public ProgressController( IProgressService progressService, ILogger <ProgressController> logger ) { _progressService = progressService; _logger = logger; }
public LogViewModel(IProgressService progressService) { ProgressService = progressService; LoadCommand = new AsyncRelayCommand(Load); ExportCommand = new AsyncRelayCommand(Export); CopyToClipboardCommand = new RelayCommand(CopyToClipboard); ClearCommand = new AsyncRelayCommand(Clear); }
public PackageService(IProgressService progressService, ISourceService sourceService, Func <IPackageViewModel> packageFactory, Func <Type, ILogService> logFunc) { _progressService = progressService; _sourceService = sourceService; _packageFactory = packageFactory; _logService = logFunc(typeof(PackageService)); }
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); }
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); }
public IssueListPageViewModel(ILoader loader, ILoader listLoader, IProgressService progressService, INavigationService navigationService, IIssueService issueService) : base(loader, listLoader, progressService, navigationService) { _issueService = issueService; Title = IssueList.Title; }
public AboutPageViewModel(IDeviceService deviceService, ILoader loader, IProgressService progressService, INavigationService navigationService) : base(loader, progressService, navigationService) { _deviceService = deviceService; Version = "1.0"; }
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, "Администратор. Авторизация"); }
/// <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; }
public LogWorkPageViewModel(ILoader loader, IProgressService progressService, INavigationService navigationService, IWorkLogService workLogService) : base(loader, progressService, navigationService) { _workLogService = workLogService; Title = LogWork.Title; Date = DateTime.Now; }
public RepoListPageViewModel(ILoader loader, ILoader listLoader, IProgressService progressService, INavigationService navigationService, IRepoService repoService) : base(loader, listLoader, progressService, navigationService) { _repoService = repoService; Title = RepoList.Title; }
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; }
public void BeforeEachTest() { if (_registry != null) { _registry.Dispose(); } _registry = new CherryServiceLocatorAndRegistry(); _progressService = null; _progressService = CreateProgressService(_registry); Assert.IsNotNull(_progressService, "Please implement the method CreateProgressService()"); }
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; }
public WorkLogsPageViewModel(ILoader loader, ILoader listLoader, IProgressService progressService, INavigationService navigationService, IWorkLogService workLogService) : base(loader, listLoader, progressService, navigationService) { _workLogService = workLogService; Title = Resources.Strings.WorkLogs.Title; }
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); }
public MyDayViewModel(IWeatherRepository weatherRepository, IProgressService progressService) { _weatherRepository = weatherRepository; _refreshCommand = new LoadingRelayCommand(Refresh); Forecasts = _weatherRepository.GetForecasts(); if (!IsInDesignMode) { if (_refreshCommand.CanExecute(null)) _refreshCommand.Execute(null); } }
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>(); }
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); }
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); } } }
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)); }
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"); }
/// <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]; } }
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>(); }
/// <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); }
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)); }
public CSharpChocolateyPackageService(IProgressService progressService, Func<Type, ILogService> logServiceFunc, IChocolateyConfigurationProvider chocolateyConfigurationProvider) : base(progressService, logServiceFunc, chocolateyConfigurationProvider) { this.chocoExePath = Path.Combine(this.ChocolateyConfigurationProvider.ChocolateyInstall, "choco.exe"); }
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(); }