internal DiffMarginViewModel(GitDiffMargin margin, IWpfTextView textView, ITextDocumentFactoryService textDocumentFactoryService, IGitCommands gitCommands) { if (margin == null) { throw new ArgumentNullException("margin"); } if (textView == null) { throw new ArgumentNullException("textView"); } if (textDocumentFactoryService == null) { throw new ArgumentNullException("textDocumentFactoryService"); } if (gitCommands == null) { throw new ArgumentNullException("gitCommands"); } _margin = margin; _textView = textView; _gitCommands = gitCommands; DiffViewModels = new ObservableCollection <DiffViewModel>(); _textView.LayoutChanged += OnLayoutChanged; _parser = new DiffUpdateBackgroundParser(textView.TextBuffer, textView.TextDataModel.DocumentBuffer, TaskScheduler.Default, textDocumentFactoryService, gitCommands); _parser.ParseComplete += HandleParseComplete; _parser.RequestParse(false); }
internal DiffViewModel(GitDiffMargin margin, HunkRangeInfo hunkRangeInfo, IWpfTextView textView, IGitCommands gitCommands) { _margin = margin; _hunkRangeInfo = hunkRangeInfo; _textView = textView; _gitCommands = gitCommands; _margin.BrushesChanged += HandleBrushesChanged; ShowPopup = false; SetDisplayProperties(); DiffText = GetDiffText(); IsDiffTextVisible = GetIsDiffTextVisible(); }
internal DiffMarginViewModel(GitDiffMargin margin, IWpfTextView textView, ITextDocumentFactoryService textDocumentFactoryService, IGitCommands gitCommands) { if (margin == null) throw new ArgumentNullException("margin"); if (textView == null) throw new ArgumentNullException("textView"); if (textDocumentFactoryService == null) throw new ArgumentNullException("textDocumentFactoryService"); if (gitCommands == null) throw new ArgumentNullException("gitCommands"); _margin = margin; _textView = textView; _gitCommands = gitCommands; DiffViewModels = new ObservableCollection<DiffViewModel>(); _textView.LayoutChanged += OnLayoutChanged; _parser = new DiffUpdateBackgroundParser(textView.TextBuffer, textView.TextDataModel.DocumentBuffer, TaskScheduler.Default, textDocumentFactoryService, gitCommands); _parser.ParseComplete += HandleParseComplete; _parser.RequestParse(false); }