GitScc.PendingChangesView.dataGrid1_MouseDoubleClick C# (CSharp) Method

dataGrid1_MouseDoubleClick() private method

Replaces the double-click functionality with a tortoise-git diff, if available.
private dataGrid1_MouseDoubleClick ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
sender object The source of the event.
e System.Windows.Input.MouseButtonEventArgs The instance containing the event data.
return void
        private void dataGrid1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (!BlinkboxSccOptions.Current.TortoiseAvailable)
            {
                // Compare the file (differs from existing implementation.
                this.GetSelectedFileFullName(fileName =>
                {
                    var sccService = BasicSccProvider.GetServiceEx<SccProviderService>();
                    sccService.CompareFile(fileName, null);
                });
                return;
            }

            // Otherwise, use tortiose git to provide the diff.
            this.GetSelectedFileFullName(fileName =>
            {
                var sccHelper = BasicSccProvider.GetServiceEx<SccHelperService>();

                // Diff the file in tortoise
                var tfsRevision = sccHelper.GetHeadRevisionHash(BlinkboxSccOptions.Current.TfsRemoteBranch);
                sccHelper.DiffFileInTortoise(fileName, tfsRevision, BlinkboxSccOptions.WorkingDirectoryRevision);
            });
        }