Example #1
0
        public void ShowBlame()
        {
            string path = dte.GetActiveDocument();

            if (!CanHandleActiveDocument(path))
            {
                return;
            }
            int?        lineNumber = dte.GetSelectedLine();
            BlameHelper helper     = new BlameHelper(Options, PortOptions);

            helper.ShowExternalBlame(path, lineNumber);
        }
        public InternalBlameViewModel(string filePath, int?lineNumber, IToolWindowViewModel tool)
        {
            this.blameHelper           = new BlameHelper(tool);
            this.mergeHelper           = new MergeHelper(tool);
            FilePath                   = filePath;
            PreviousRevisionCommand    = new DelegateCommand(NavigateToPreviousRevision, CanNavigateToPreviousRevision);
            NextRevisionCommand        = new DelegateCommand(NavigateToNextRevision, CanNavigateToNextRevision);
            SpecifiedRevisionCommand   = new DelegateCommand(NavigateToSpecifiedRevision, CanNavigateToSpecifiedRevision);
            LastRevisionCommand        = new DelegateCommand(NavigateToLastRevision, CanNavigateToLastRevision);
            CompareWithPreviousCommand = new DelegateCommand(CompareWithPrevious, CanCompareWithPrevious);
            CompareCurrentFileCommand  = new DelegateCommand(CompareCurrentFile, CanCompareCurrentFile);
            CopyCommentCommand         = new DelegateCommand(CopyComment, CanCopyComment);

            int line = lineNumber - 1 ?? 0;

            InitializeFileDiffInfo();
            Blame           = fileDiffInfo.BlameAtRevision(LastRevision);
            CurrentRevision = LastRevision;
            CurrentLine     = Blame.ElementAtOrDefault(line);
        }
Example #3
0
        public void ShowBlame()
        {
            string path = dte.GetActiveDocument();

            if (!CanHandleActiveDocument(path))
            {
                return;
            }


            int?        lineNumber = dte.GetSelectedLine();
            BlameHelper helper     = new BlameHelper(this);

            if (Options.BlameType == DXBlameType.External)
            {
                helper.ShowExternalBlame(path, lineNumber);
            }
            else
            {
                helper.ShowInternalBlame(path, lineNumber, model => internalBlameWindowAccessor().Initialize(model));
            }
        }