Ejemplo n.º 1
0
        internal MainWindowViewModel(
            WorkingFolder workingFolder,
            WindowOwner owner,
            IRepositoryCommands repositoryCommands,
            IRemoteService remoteService,
            ICommitsService commitsService,
            ILatestVersionService latestVersionService,
            IStartInstanceService startInstanceService,
            IRecentReposService recentReposService,
            IGitInfoService gitInfoService,
            IMessage message,
            IMainWindowService mainWindowService,
            MainWindowIpcService mainWindowIpcService,
            RepositoryViewModel repositoryViewModel)
        {
            this.workingFolder        = workingFolder;
            this.owner                = owner;
            this.repositoryCommands   = repositoryCommands;
            this.remoteService        = remoteService;
            this.commitsService       = commitsService;
            this.startInstanceService = startInstanceService;
            this.recentReposService   = recentReposService;
            this.gitInfoService       = gitInfoService;
            this.message              = message;
            this.mainWindowService    = mainWindowService;
            this.mainWindowIpcService = mainWindowIpcService;

            RepositoryViewModel = repositoryViewModel;

            workingFolder.OnChange += (s, e) => Notify(nameof(WorkingFolder));
            latestVersionService.OnNewVersionAvailable += (s, e) => IsNewVersionVisible = true;
            latestVersionService.StartCheckForLatestVersion();
            IsRepoView = true;
        }
Ejemplo n.º 2
0
        public OpenRepoViewModel(
            IOpenRepoService openRepoService,
            IRecentReposService recentReposService,
            IThemeService themeService)
        {
            this.openRepoService    = openRepoService;
            this.recentReposService = recentReposService;
            this.themeService       = themeService;
            Rect = DefaultOpenBounds;

            RecentFiles = GetRecentFiles();
        }
Ejemplo n.º 3
0
 public OpenRepoService(
     IRecentReposService recentReposService,
     IGitInfoService gitInfoService,
     IGitRepoService gitRepoService,
     IStartInstanceService startInstanceService,
     IMessage message,
     IProgressService progressService,
     WindowOwner owner)
 {
     this.owner = owner;
     this.recentReposService   = recentReposService;
     this.gitInfoService       = gitInfoService;
     this.gitRepoService       = gitRepoService;
     this.startInstanceService = startInstanceService;
     this.message         = message;
     this.progressService = progressService;
 }
Ejemplo n.º 4
0
        public RepositoryViewModel(
            WorkingFolder workingFolder,
            IDiffService diffService,
            ICommandLine commandLine,
            IViewModelService viewModelService,
            ICommitsService commitsService,
            IRepositoryService repositoryService,
            IGitFetchService gitFetchService,
            IThemeService themeService,
            IOpenRepoService openRepoService,
            IRecentReposService recentReposService,
            IMessage message,
            IProgressService progressService,
            Func <CommitDetailsViewModel> commitDetailsViewModelProvider)
        {
            this.workingFolder     = workingFolder;
            this.diffService       = diffService;
            this.commandLine       = commandLine;
            this.viewModelService  = viewModelService;
            this.commitsService    = commitsService;
            this.repositoryService = repositoryService;

            this.gitFetchService = gitFetchService;

            this.themeService       = themeService;
            this.openRepoService    = openRepoService;
            this.recentReposService = recentReposService;
            this.message            = message;
            this.progress           = progressService;

            VirtualItemsSource = new RepositoryVirtualItemsSource(Branches, Merges, Commits, OpenRepos);

            filterTriggerTimer.Tick    += FilterTrigger;
            filterTriggerTimer.Interval = FilterDelay;

            CommitDetailsViewModel = commitDetailsViewModelProvider();

            repositoryService.RepositoryUpdated      += (s, e) => OnRepositoryUpdated();
            repositoryService.RepositoryErrorChanged += (s, e) => FetchErrorText = e.ErrorText;
        }