public DiffMarginViewModel(DiffMargin 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 List <DiffViewModel>();
            _previousChangeCommand = new RelayCommand <DiffViewModel>(PreviousChange, PreviousChangeCanExecute);
            _nextChangeCommand     = new RelayCommand <DiffViewModel>(NextChange, NextChangeCanExecute);

            _textView.LayoutChanged += OnLayoutChanged;

            _parser = new DiffUpdateBackgroundParser(textView.TextBuffer, textView.TextDataModel.DocumentBuffer, TaskScheduler.Default, textDocumentFactoryService, gitCommands);
            _parser.ParseComplete += HandleParseComplete;
            _parser.RequestParse(false);
        }
Exemplo n.º 2
0
        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);
        }
        public DiffMarginViewModel(DiffMargin 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>();
            _previousChangeCommand = new RelayCommand<DiffViewModel>(PreviousChange, PreviousChangeCanExecute);
            _nextChangeCommand = new RelayCommand<DiffViewModel>(NextChange, NextChangeCanExecute);

            _textView.LayoutChanged += OnLayoutChanged;
            _textView.ViewportHeightChanged += OnViewportHeightChanged;

            _parser = new DiffUpdateBackgroundParser(textView.TextBuffer, TaskScheduler.Default, textDocumentFactoryService, gitCommands);
            _parser.ParseComplete += HandleParseComplete;
            _parser.RequestParse(false);
        }
        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);
        }