Пример #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;
        }
 public CommitDetailsViewModel(
     IDiffService diffService,
     IThemeService themeService,
     ICommitsService commitsService)
 {
     this.diffService    = diffService;
     this.themeService   = themeService;
     this.commitsService = commitsService;
 }
        //private static readonly string TestSubject =
        //"01234567890123456789012345678901234567890123456789]";

        //private static readonly string TestDescription =
        //"012345678901234567890123456789012345678901234567890123456789012345678912]";


        public CommitDialogViewModel(
            ICommitsService commitsService,
            WorkingFolder workingFolder,
            IDiffService diffService,
            IThemeService themeService,
            IMessage message,
            BranchName branchName,
            IEnumerable <CommitFile> files,
            string commitMessage,
            bool isMerging)
        {
            CommitFiles = files.ToList();

            this.commitsService = commitsService;
            this.diffService    = diffService;
            this.themeService   = themeService;
            this.message        = message;
            this.isMerging      = isMerging;

            files.ForEach(f => Files.Add(
                              ToCommitFileViewModel(workingFolder, f)));

            if (!string.IsNullOrWhiteSpace(commitMessage))
            {
                string[] lines              = commitMessage.Split("\n".ToCharArray());
                string   subject            = lines[0];
                string   mergeSubjectSuffix = $" into {branchName}";
                if (!subject.EndsWith(mergeSubjectSuffix))
                {
                    subject += mergeSubjectSuffix;
                }

                Subject = subject;

                if (lines.Length > 1)
                {
                    Description = string.Join("\n", lines.Skip(1));
                }
            }

            BranchText = isMerging ? $"Commit merge to {branchName}" : $"Commit on {branchName}";
            //Subject = TestSubject;
            //Description = TestDescription;
        }
Пример #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;
        }
        //private readonly IDiffService diffService;



        public RepositoryStructureService(
            IBranchService branchService,
            IStatusService statusService,
            ICommitBranchNameService commitBranchNameService,
            IGitCommitBranchNameService gitCommitBranchNameService,
            IBranchHierarchyService branchHierarchyService,
            ITagService tagService,
            ICommitsService commitsService,
            IGitBranchService gitBranchService
            //IDiffService diffService
            )
        {
            this.branchService              = branchService;
            this.statusService              = statusService;
            this.commitBranchNameService    = commitBranchNameService;
            this.gitCommitBranchNameService = gitCommitBranchNameService;
            this.branchHierarchyService     = branchHierarchyService;
            this.tagService       = tagService;
            this.commitsService   = commitsService;
            this.gitBranchService = gitBranchService;
            //this.diffService = diffService;
        }
        public ViewModelService(
            IBranchService branchService,
            IDiffService diffService,
            ICommitsService commitsService,
            ITagService tagService,
            IThemeService themeService,
            IMessage message,
            IRepositoryMgr repositoryMgr,
            IRepositoryCommands repositoryCommands,
            Func <BranchViewModel> branchViewModelProvider)
        {
            this.branchService           = branchService;
            this.diffService             = diffService;
            this.commitsService          = commitsService;
            this.tagService              = tagService;
            this.themeService            = themeService;
            this.message                 = message;
            this.repositoryMgr           = repositoryMgr;
            this.repositoryCommands      = repositoryCommands;
            this.branchViewModelProvider = branchViewModelProvider;

            this.deleteBranchCommand = new Command <Branch>(
                branchService.DeleteBranchAsync, branchService.CanDeleteBranch, nameof(deleteBranchCommand));
        }
Пример #7
0
 public CommitsController(ICommitsService commitsService)
 {
     this.commits = commitsService;
 }
 public CommitsController(ICommitsService commitsService, IRepositoriesService repositoriesService)
 {
     this.commitsService      = commitsService;
     this.repositoriesService = repositoriesService;
 }
Пример #9
0
 public CommitsController(ICommitsService commitsService)
 {
     this.commits = commitsService;
 }
Пример #10
0
 public void Init()
 {
     this.commitsService = TestObjectFactory.GetCommitsService();
 }
 public void Init()
 {
     this.commitsService = TestObjectFactory.GetCommitsService();
 }
Пример #12
0
 public CommitsController(ICommitsService service)
 {
     this.service = service;
 }
Пример #13
0
 public MainWindowIpcService(ICommitsService commitsService)
 {
     this.commitsService = commitsService;
 }