Exemplo n.º 1
0
 public GitProject(GitProjectInfo gitProjectInfo, UserOptions userOptions)
 {
     ProjectInfo = gitProjectInfo;
     _userOptions = userOptions;
     RefreshSubmodules();
     UpdateRemoteUrls();
     SetServiceForModules();
     Refresh();
 }
Exemplo n.º 2
0
 public void ChangeCurrentProject(GitProjectInfo projectInfo)
 {
     CurrentGitProject = CurrentGitProjectList.GetOrAddProject(projectInfo, _userOptions);
 }
Exemplo n.º 3
0
 private void LoadProject(GitProjectInfo projectInfo)
 {
     lock (projectInfo)
     {
         _logger.Info("Loading " + projectInfo.Caption);
         var gitProject = CurrentGitProjectList.GetOrAddProject(projectInfo, _userOptions);
         gitProject.RefreshStatuses();
     }
 }
Exemplo n.º 4
0
 public void RemoveGitProject(GitProjectInfo gitProjectInfo)
 {
     var gitProject = CurrentGitProjectList.Items.FirstOrDefault(p => p.WorkingDirectory == gitProjectInfo.Folder);
     if (gitProject == null) return;
     CurrentGitProjectList.Items.Remove(gitProject);
     XmlHelper.Save(CurrentGitProjectList, AppConfiguration.GitProjectsFileName);
 }
Exemplo n.º 5
0
 public List<GitModuleInfo> GetDirtyModules(GitProjectInfo gitProjectInfo)
 {
     return CurrentGitProjectList.GetDirtyModules(gitProjectInfo);
 }
Exemplo n.º 6
0
 public void AddProject(GitProjectInfo projectInfo)
 {
     var copy = new List<GitProjectInfo>(GitProjects);
     copy.Add(projectInfo);
     GitProjects = copy;
 }
Exemplo n.º 7
0
 public List<GitModuleInfo> GetDirtyModules(GitProjectInfo gitProjectInfo)
 {
     return gitProjectInfo == null
         ? GetFullModuleList().Where(m => m.Status.IsDirty()).ToList()
         : GetProject(gitProjectInfo.Folder).Modules.Where(m => m.Status.IsDirty()).ToList();
 }
Exemplo n.º 8
0
 public GitProject GetOrAddProject(GitProjectInfo projectInfo, UserOptions userOptions)
 {
     lock (projectInfo)
     {
         var gitProject = GetProject(projectInfo.Folder);
         if (gitProject == null)
         {
             gitProject = new GitProject(projectInfo, userOptions);
             Items.Add(gitProject);
         }
         return gitProject;
     }
 }