Example #1
0
        internal EditorDiffMargin(IWpfTextView textView, UnifiedDiff unifiedDiff, IMarginCore marginCore)
            : base(textView)
        {
            ViewModel = new EditorDiffMarginViewModel(marginCore, unifiedDiff, UpdateDiffDimensions);

            UserControl = new EditorDiffMarginControl {DataContext = ViewModel, Width = MarginWidth};
        }
Example #2
0
        protected DiffViewModel(HunkRangeInfo hunkRangeInfo, IMarginCore marginCore, Action <DiffViewModel, HunkRangeInfo> updateDiffDimensions)
        {
            HunkRangeInfo         = hunkRangeInfo;
            MarginCore            = marginCore;
            _updateDiffDimensions = updateDiffDimensions;

            MarginCore.BrushesChanged += HandleBrushesChanged;
        }
        internal ScrollDiffMarginViewModel(IMarginCore marginCore, Action<DiffViewModel, HunkRangeInfo> updateDiffDimensions)
            : base(marginCore)
        {
            if (updateDiffDimensions == null)
                throw new ArgumentNullException("updateDiffDimensions");

            _updateDiffDimensions = updateDiffDimensions;
        }
Example #4
0
        protected DiffViewModel(HunkRangeInfo hunkRangeInfo, IMarginCore marginCore, Action<DiffViewModel, HunkRangeInfo> updateDiffDimensions)
        {
            HunkRangeInfo = hunkRangeInfo;
            MarginCore = marginCore;
            _updateDiffDimensions = updateDiffDimensions;

            MarginCore.BrushesChanged += HandleBrushesChanged;
        }
        internal EditorDiffMargin(IWpfTextView textView, IMarginCore marginCore)
            : base(textView)
        {
            ViewModel = new EditorDiffMarginViewModel(marginCore, UpdateDiffDimensions);

            UserControl = new EditorDiffMarginControl {
                DataContext = ViewModel, Width = MarginWidth
            };
        }
        protected DiffMarginViewModelBase(IMarginCore marginCore)
        {
            if (marginCore == null)
                throw new ArgumentNullException(nameof(marginCore));

            MarginCore = marginCore;

            DiffViewModels = new ObservableCollection<DiffViewModel>();
        }
        internal EditorDiffMarginViewModel(IMarginCore marginCore, Action <DiffViewModel, HunkRangeInfo> updateDiffDimensions) :
            base(marginCore)
        {
            if (updateDiffDimensions == null)
            {
                throw new ArgumentNullException("updateDiffDimensions");
            }

            _updateDiffDimensions = updateDiffDimensions;
        }
Example #8
0
        internal EditorDiffViewModel(HunkRangeInfo hunkRangeInfo, IMarginCore marginCore, Action <DiffViewModel, HunkRangeInfo> updateDiffDimensions)
            : base(hunkRangeInfo, marginCore, updateDiffDimensions)
        {
            ShowPopup = false;

            DiffText = GetDiffText();

            IsDiffTextVisible = GetIsDiffTextVisible();

            UpdateDimensions();
        }
Example #9
0
        internal ScrollDiffMargin(IWpfTextView textView, UnifiedDiff unifiedDiff, IMarginCore marginCore, IWpfTextViewMargin containerMargin)
            : base(textView)
        {
            var scrollBarMargin = containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar);
            // ReSharper disable once SuspiciousTypeConversion.Global
            _scrollBar = (IVerticalScrollBar)scrollBarMargin;

            ViewModel = new ScrollDiffMarginViewModel(marginCore, unifiedDiff, UpdateDiffDimensions);

            UserControl = new ScrollDiffMarginControl { DataContext = ViewModel, Width = MarginWidth, MaxWidth = MarginWidth, MinWidth = MarginWidth};
        }
        internal EditorDiffViewModel(HunkRangeInfo hunkRangeInfo, IMarginCore marginCore, Action<DiffViewModel, HunkRangeInfo> updateDiffDimensions)
            : base(hunkRangeInfo, marginCore, updateDiffDimensions)
        {
            ShowPopup = false;

            DiffText = GetDiffText();

            IsDiffTextVisible = GetIsDiffTextVisible();

            UpdateDimensions();
        }
        protected DiffMarginViewModelBase(IMarginCore marginCore)
        {
            if (marginCore == null)
                throw new ArgumentNullException("marginCore");

            MarginCore = marginCore;

            DiffViewModels = new ObservableCollection<DiffViewModel>();

            MarginCore.HunksChanged += HandleHunksChanged;
        }
        protected DiffMarginViewModelBase(IMarginCore marginCore)
        {
            if (marginCore == null)
            {
                throw new ArgumentNullException("marginCore");
            }

            MarginCore = marginCore;

            DiffViewModels = new ObservableCollection <DiffViewModel>();

            MarginCore.HunksChanged += HandleHunksChanged;
        }
        internal EditorDiffMarginViewModel(IMarginCore marginCore, UnifiedDiff unifiedDiff, Action<DiffViewModel, HunkRangeInfo> updateDiffDimensions)
            : base(marginCore)
        {
            if (updateDiffDimensions == null)
                throw new ArgumentNullException(nameof(updateDiffDimensions));

            _updateDiffDimensions = updateDiffDimensions;

            foreach (var diffViewModel in unifiedDiff.HunkRanges.Select(CreateDiffViewModel))
            {
                DiffViewModels.Add(diffViewModel);
            }
        }
Example #14
0
        internal ScrollDiffMargin(IWpfTextView textView, IMarginCore marginCore, IWpfTextViewMargin containerMargin)
            : base(textView)
        {
            var scrollBarMargin = containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar);

            // ReSharper disable once SuspiciousTypeConversion.Global
            _scrollBar = (IVerticalScrollBar)scrollBarMargin;

            ViewModel = new ScrollDiffMarginViewModel(marginCore, UpdateDiffDimensions);

            UserControl = new ScrollDiffMarginControl {
                DataContext = ViewModel, Width = MarginWidth, MaxWidth = MarginWidth, MinWidth = MarginWidth
            };
        }
 internal ScrollDiffViewModel(HunkRangeInfo hunkRangeInfo, IMarginCore marginCore, Action <DiffViewModel, HunkRangeInfo> updateDiffDimensions)
     : base(hunkRangeInfo, marginCore, updateDiffDimensions)
 {
     UpdateDimensions();
 }
 internal ScrollDiffViewModel(HunkRangeInfo hunkRangeInfo, IMarginCore marginCore, Action<DiffViewModel, HunkRangeInfo> updateDiffDimensions)
     : base(hunkRangeInfo, marginCore, updateDiffDimensions)
 {
     UpdateDimensions();
 }