Inheritance: DiffMarginViewModelBase
コード例 #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};
        }
コード例 #2
0
 //private void Rollback()
 //{
 //    if (!MarginCore.RollBack(HunkRangeInfo)) return;
 //    // immediately hide the change
 //    _reverted = true;
 //    //ShowPopup = false;
 //    IsVisible = false;
 //    // Make sure the view is focused afterwards
 //    MarginCore.TextView.VisualElement.Focus();
 //}
 private void ShowPopUp(EditorDiffMarginViewModel diffMarginViewModel)
 {
     _diffMarginViewModel = diffMarginViewModel;
     ShowPopup = true;
 }
コード例 #3
0
        private bool TryGetMarginViewModel(out EditorDiffMarginViewModel viewModel)
        {
            viewModel = null;

            IWpfTextViewHost textViewHost = _editorAdaptersFactoryService.GetWpfTextViewHost(TextViewAdapter);
            if (textViewHost == null)
                return false;

            EditorDiffMargin margin = textViewHost.GetTextViewMargin(EditorDiffMargin.MarginNameConst) as EditorDiffMargin;
            if (margin == null)
                return false;

            viewModel = margin.VisualElement.DataContext as EditorDiffMarginViewModel;
            return viewModel != null;
        }