コード例 #1
0
        public async Task <Stream> OpenBaseVersionAsync(FileName fileName)
        {
            if (!Git.IsInWorkingCopy(fileName))
            {
                return(null);
            }

            string git = Git.FindGit();

            if (git == null)
            {
                return(null);
            }

            return(OpenOutput(git, fileName, await GetBlobHashAsync(git, fileName).ConfigureAwait(false)));
        }
コード例 #2
0
        public Stream OpenBaseVersion(string fileName)
        {
            if (!Git.IsInWorkingCopy(fileName))
            {
                return(null);
            }

            string git = Git.FindGit();

            if (git == null)
            {
                return(null);
            }

            return(OpenOutput(git, fileName, GetBlobHash(git, fileName)));
        }
コード例 #3
0
        public IDisposable WatchBaseVersionChanges(FileName fileName, EventHandler callback)
        {
            if (!File.Exists(fileName))
            {
                return(null);
            }
            if (!Git.IsInWorkingCopy(fileName))
            {
                return(null);
            }

            string git = Git.FindGit();

            if (git == null)
            {
                return(null);
            }

            return(new BaseVersionChangeWatcher(fileName, GetBlobHashAsync(git, fileName).Result, callback));
        }
コード例 #4
0
        public bool IsValid(object caller, Condition condition)
        {
            FileNode node = ProjectBrowserPad.Instance.SelectedNode as FileNode;

            if (node != null)
            {
                return(Git.IsInWorkingCopy(node.FileName));
            }
            DirectoryNode dir = ProjectBrowserPad.Instance.SelectedNode as DirectoryNode;

            if (dir != null)
            {
                return(Git.IsInWorkingCopy(dir.Directory));
            }
            SolutionNode sol = ProjectBrowserPad.Instance.SelectedNode as SolutionNode;

            if (sol != null)
            {
                return(Git.IsInWorkingCopy(sol.Solution.Directory));
            }
            return(false);
        }