コード例 #1
0
        private bool GetNextPatchFile(bool searchBackward, bool loop, out int fileIndex, out Task loadFileContent)
        {
            fileIndex       = -1;
            loadFileContent = Task.CompletedTask;
            if (DiffFiles.Revision == null)
            {
                return(false);
            }

            int idx = DiffFiles.SelectedIndex;

            if (idx == -1)
            {
                return(false);
            }

            fileIndex = DiffFiles.GetNextIndex(searchBackward, loop);
            if (fileIndex == idx)
            {
                if (!loop)
                {
                    return(false);
                }
            }
            else
            {
                DiffFiles.SetSelectedIndex(fileIndex, notify: false);
            }

            loadFileContent = ShowSelectedFileDiffAsync();
            return(true);
        }
コード例 #2
0
        private bool GetNextPatchFile(bool searchBackward, bool loop, out int fileIndex, out Task loadFileContent)
        {
            fileIndex       = -1;
            loadFileContent = Task.FromResult <string>(null);
            var revisions = _revisionGrid.GetSelectedRevisions();

            if (revisions.Count == 0)
            {
                return(false);
            }

            int idx = DiffFiles.SelectedIndex;

            if (idx == -1)
            {
                return(false);
            }

            fileIndex = DiffFiles.GetNextIndex(searchBackward, loop);
            if (fileIndex == idx)
            {
                if (!loop)
                {
                    return(false);
                }
            }
            else
            {
                DiffFiles.SetSelectedIndex(fileIndex, notify: false);
            }
            loadFileContent = ShowSelectedFileDiff();
            return(true);
        }