예제 #1
0
        private void openWithDifftoolToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DiffFiles.SelectedItem == null)
            {
                return;
            }

            GitUI.RevisionDiffKind diffKind;

            if (sender == aLocalToolStripMenuItem)
            {
                diffKind = GitUI.RevisionDiffKind.DiffALocal;
            }
            else if (sender == bLocalToolStripMenuItem)
            {
                diffKind = GitUI.RevisionDiffKind.DiffBLocal;
            }
            else if (sender == parentOfALocalToolStripMenuItem)
            {
                diffKind = GitUI.RevisionDiffKind.DiffAParentLocal;
            }
            else if (sender == parentOfBLocalToolStripMenuItem)
            {
                diffKind = GitUI.RevisionDiffKind.DiffBParentLocal;
            }
            else
            {
                diffKind = GitUI.RevisionDiffKind.DiffAB;
            }

            foreach (var itemWithParent in DiffFiles.SelectedItemsWithParent)
            {
                _revisionGrid.OpenWithDifftool(itemWithParent.Item.Name, itemWithParent.Item.OldName, diffKind, itemWithParent.Item.IsTracked);
            }
        }
예제 #2
0
        private void openWithDifftoolToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DiffFiles.SelectedItem == null)
            {
                return;
            }

            GitUIExtensions.DiffWithRevisionKind diffKind;

            if (sender == aLocalToolStripMenuItem)
            {
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffALocal;
            }
            else if (sender == bLocalToolStripMenuItem)
            {
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffBLocal;
            }
            else if (sender == parentOfALocalToolStripMenuItem)
            {
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffAParentLocal;
            }
            else if (sender == parentOfBLocalToolStripMenuItem)
            {
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffBParentLocal;
            }
            else
            {
                Debug.Assert(sender == aBToolStripMenuItem, "Not implemented DiffWithRevisionKind: " + sender);
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffAB;
            }

            foreach (var itemWithParent in DiffFiles.SelectedItemsWithParent)
            {
                GitItemStatus selectedItem = itemWithParent.Item;
                string        parentGuid   = _revisionGrid.GetSelectedRevisions().Count() == 1 ? itemWithParent.ParentGuid : null;

                _revisionGrid.OpenWithDifftool(selectedItem.Name, selectedItem.OldName, diffKind, parentGuid);
            }
        }
예제 #3
0
        private void openWithDifftoolToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DiffFiles.SelectedItem == null)
            {
                return;
            }

            RevisionDiffKind diffKind;

            if (sender == firstToLocalToolStripMenuItem)
            {
                diffKind = RevisionDiffKind.DiffALocal;
            }
            else if (sender == selectedToLocalToolStripMenuItem)
            {
                diffKind = RevisionDiffKind.DiffBLocal;
            }
            else if (sender == firstParentToLocalToolStripMenuItem)
            {
                diffKind = RevisionDiffKind.DiffAParentLocal;
            }
            else if (sender == selectedParentToLocalToolStripMenuItem)
            {
                diffKind = RevisionDiffKind.DiffBParentLocal;
            }
            else
            {
                Debug.Assert(sender == firstToSelectedToolStripMenuItem, "Not implemented DiffWithRevisionKind: " + sender);
                diffKind = RevisionDiffKind.DiffAB;
            }

            foreach (var itemWithParent in DiffFiles.SelectedItemsWithParent)
            {
                IList <GitRevision> revs = new List <GitRevision> {
                    DiffFiles.Revision, itemWithParent.ParentRevision
                };
                _revisionGrid.OpenWithDifftool(revs, itemWithParent.Item.Name, itemWithParent.Item.OldName, diffKind, itemWithParent.Item.IsTracked);
            }
        }
예제 #4
0
        private void openWithDifftoolToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DiffFiles.SelectedItem == null)
            {
                return;
            }

            var selectedItem = DiffFiles.SelectedItem;

            GitUIExtensions.DiffWithRevisionKind diffKind;

            if (sender == aLocalToolStripMenuItem)
            {
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffALocal;
            }
            else if (sender == bLocalToolStripMenuItem)
            {
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffBLocal;
            }
            else if (sender == parentOfALocalToolStripMenuItem)
            {
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffAParentLocal;
            }
            else if (sender == parentOfBLocalToolStripMenuItem)
            {
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffBParentLocal;
            }
            else
            {
                Debug.Assert(sender == aBToolStripMenuItem, "Not implemented DiffWithRevisionKind: " + sender);
                diffKind = GitUIExtensions.DiffWithRevisionKind.DiffAB;
            }

            string parentGuid = RevisionGrid.GetSelectedRevisions().Count() == 1 ? DiffFiles.SelectedItemParent : null;

            RevisionGrid.OpenWithDifftool(selectedItem.Name, selectedItem.OldName, diffKind, parentGuid);
        }
예제 #5
0
        private void openWithDifftoolToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DiffFiles.SelectedItem == null)
            {
                return;
            }

            GitUI.RevisionDiffKind diffKind;

            if (sender == aLocalToolStripMenuItem)
            {
                diffKind = GitUI.RevisionDiffKind.DiffALocal;
            }
            else if (sender == bLocalToolStripMenuItem)
            {
                diffKind = GitUI.RevisionDiffKind.DiffBLocal;
            }
            else if (sender == parentOfALocalToolStripMenuItem)
            {
                diffKind = GitUI.RevisionDiffKind.DiffAParentLocal;
            }
            else if (sender == parentOfBLocalToolStripMenuItem)
            {
                diffKind = GitUI.RevisionDiffKind.DiffBParentLocal;
            }
            else
            {
                Debug.Assert(sender == aBToolStripMenuItem, "Not implemented DiffWithRevisionKind: " + sender);
                diffKind = GitUI.RevisionDiffKind.DiffAB;
            }

            foreach (var selectedItem in DiffFiles.SelectedItems)
            {
                _RevisionGrid.OpenWithDifftool(selectedItem.Name, selectedItem.OldName, diffKind, selectedItem.IsTracked);
            }
        }
예제 #6
0
        private void openWithDifftoolToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DiffFiles.SelectedItem == null || DiffFiles.Revision == null)
            {
                return;
            }

            RevisionDiffKind diffKind;

            if (sender == firstToLocalToolStripMenuItem)
            {
                diffKind = RevisionDiffKind.DiffALocal;
            }
            else if (sender == selectedToLocalToolStripMenuItem)
            {
                diffKind = RevisionDiffKind.DiffBLocal;
            }
            else if (sender == firstParentToLocalToolStripMenuItem)
            {
                diffKind = RevisionDiffKind.DiffAParentLocal;
            }
            else if (sender == selectedParentToLocalToolStripMenuItem)
            {
                diffKind = RevisionDiffKind.DiffBParentLocal;
            }
            else
            {
                diffKind = RevisionDiffKind.DiffAB;
            }

            foreach (var itemWithParent in DiffFiles.SelectedItemsWithParent)
            {
                var revs = new[] { DiffFiles.Revision, itemWithParent.ParentRevision };
                _revisionGrid.OpenWithDifftool(revs, itemWithParent.Item.Name, itemWithParent.Item.OldName, diffKind, itemWithParent.Item.IsTracked);
            }
        }