예제 #1
0
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            IToolWindowViewModel model = item as IToolWindowViewModel;

            if (model == null)
            {
                return(base.SelectTemplate(null, container));
            }
            if (model.Options.UseFlatUI)
            {
                return(((FrameworkElement)container).FindResource("FlatDataTemplate") as DataTemplate);
            }
            return(((FrameworkElement)container).FindResource("TreeDataTemplate") as DataTemplate);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public MergeHelper(IToolWindowViewModel tool)
 {
     ToolWindowViewModel = tool;
 }
예제 #4
0
 public BlameHelper(IToolWindowViewModel tool)
 {
     toolWindowViewModel = tool;
 }