コード例 #1
0
 internal BlockCaretFactoryService(IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IControlCharUtil controlCharUtil, IVimProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService    = formatMapService;
     _controlCharUtil     = controlCharUtil;
     _protectedOperations = protectedOperations;
 }
コード例 #2
0
ファイル: BlockCaret.cs プロジェクト: reavessm/VsVim
        internal BlockCaret(
            IVimBufferData vimBufferData,
            IClassificationFormatMap classificationFormatMap,
            IEditorFormatMap formatMap,
            IAdornmentLayer layer,
            IControlCharUtil controlCharUtil,
            IProtectedOperations protectedOperations)
        {
            _vimBufferData           = vimBufferData;
            _textView                = (IWpfTextView)_vimBufferData.TextView;
            _selectionUtil           = _vimBufferData.SelectionUtil;
            _editorFormatMap         = formatMap;
            _adornmentLayer          = layer;
            _protectedOperations     = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil         = controlCharUtil;

            _textView.LayoutChanged              += OnCaretEvent;
            _textView.GotAggregateFocus          += OnCaretEvent;
            _textView.LostAggregateFocus         += OnCaretEvent;
            _textView.Selection.SelectionChanged += OnCaretPositionOrSelectionChanged;
            _textView.Closed += OnTextViewClosed;

            _blinkTimer = CreateBlinkTimer(protectedOperations, OnCaretBlinkTimer);
        }
コード例 #3
0
 internal BlockCaretFactoryService(IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IControlCharUtil controlCharUtil, IVimProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService = formatMapService;
     _controlCharUtil = controlCharUtil;
     _protectedOperations = protectedOperations;
 }
コード例 #4
0
        internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations)
        {
            _textView                = textView;
            _editorFormatMap         = formatMap;
            _adornmentLayer          = layer;
            _protectedOperations     = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil         = controlCharUtil;

            _textView.LayoutChanged         += OnCaretEvent;
            _textView.GotAggregateFocus     += OnCaretEvent;
            _textView.LostAggregateFocus    += OnCaretEvent;
            _textView.Caret.PositionChanged += OnCaretPositionChanged;
            _textView.Closed += OnTextViewClosed;

            var caretBlinkTime     = GetCaretBlinkTime();
            var caretBlinkTimeSpan = new TimeSpan(0, 0, 0, 0, caretBlinkTime ?? Int32.MaxValue);

            _blinkTimer = new DispatcherTimer(
                caretBlinkTimeSpan,
                DispatcherPriority.Normal,
                _protectedOperations.GetProtectedEventHandler(OnCaretBlinkTimer),
                Dispatcher.CurrentDispatcher);
            _blinkTimer.IsEnabled = caretBlinkTime != null;
        }
コード例 #5
0
 internal CharDisplayTaggerSourceFactory(IVim vim, IEditorFormatMapService editorFormatMapService, IControlCharUtil controlCharUtil, IClassificationFormatMapService classificationFormatMapService)
 {
     _editorFormatMapService = editorFormatMapService;
     _vim             = vim;
     _controlCharUtil = controlCharUtil;
     _classificationFormatMapService = classificationFormatMapService;
 }
コード例 #6
0
 protected virtual void Create(params string[] lines)
 {
     _textView = CreateTextView(lines);
     _textBuffer = _textView.TextBuffer;
     _controlCharUtil = new ControlCharUtil();
     _source = new CharDisplayTaggerSource(_textView, new Mock<IEditorFormatMap>(MockBehavior.Loose).Object, _controlCharUtil);
     _basicTaggerSource = _source;
 }
コード例 #7
0
 protected virtual void Create(params string[] lines)
 {
     _textView          = CreateTextView(lines);
     _textBuffer        = _textView.TextBuffer;
     _controlCharUtil   = new ControlCharUtil();
     _source            = new CharDisplayTaggerSource(_textView, new Mock <IEditorFormatMap>(MockBehavior.Loose).Object, _controlCharUtil);
     _basicTaggerSource = _source;
 }
コード例 #8
0
            public SettingsSync(IVimApplicationSettings vimApplicationSettings, IMarkDisplayUtil markDisplayUtil, IControlCharUtil controlCharUtil)
            {
                VimApplicationSettings = vimApplicationSettings;
                MarkDisplayUtil        = markDisplayUtil;
                ControlCharUtil        = controlCharUtil;

                MarkDisplayUtil.HideMarksChanged           += SyncToApplicationSettings;
                ControlCharUtil.DisplayControlCharsChanged += SyncToApplicationSettings;
                VimApplicationSettings.SettingsChanged     += SyncFromApplicationSettings;
            }
コード例 #9
0
        internal CharDisplayTaggerSource(ITextView textView, IEditorFormatMap editorFormatMap, IControlCharUtil controlCharUtil)
        {
            _textView        = textView;
            _editorFormatMap = editorFormatMap;
            _controlCharUtil = controlCharUtil;
            UpdateBrushes();

            _textView.TextBuffer.Changed                += OnTextBufferChanged;
            _editorFormatMap.FormatMappingChanged       += OnFormatMappingChanged;
            _controlCharUtil.DisplayControlCharsChanged += OnSettingChanged;
        }
コード例 #10
0
ファイル: BlockCaret.cs プロジェクト: KinHimTang/VsVim
 internal BlockCaret(
     IWpfTextView textView,
     string adornmentLayerName,
     IClassificationFormatMap classificationFormatMap,
     IEditorFormatMap formatMap,
     IControlCharUtil controlCharUtil,
     IProtectedOperations protectedOperations) :
     this(
         textView,
         classificationFormatMap,
         formatMap,
         textView.GetAdornmentLayer(adornmentLayerName),
         controlCharUtil,
         protectedOperations)
 {
 }
コード例 #11
0
ファイル: BlockCaret.cs プロジェクト: reavessm/VsVim
 internal BlockCaret(
     IVimBufferData vimBufferData,
     string adornmentLayerName,
     IClassificationFormatMap classificationFormatMap,
     IEditorFormatMap formatMap,
     IControlCharUtil controlCharUtil,
     IProtectedOperations protectedOperations) :
     this(
         vimBufferData,
         classificationFormatMap,
         formatMap,
         (vimBufferData.TextView as IWpfTextView).GetAdornmentLayer(adornmentLayerName),
         controlCharUtil,
         protectedOperations)
 {
 }
コード例 #12
0
        internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations)
        {
            _textView                = textView;
            _editorFormatMap         = formatMap;
            _adornmentLayer          = layer;
            _protectedOperations     = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil         = controlCharUtil;

            _textView.LayoutChanged         += OnCaretEvent;
            _textView.GotAggregateFocus     += OnCaretEvent;
            _textView.LostAggregateFocus    += OnCaretEvent;
            _textView.Caret.PositionChanged += OnCaretPositionChanged;
            _textView.Closed += OnTextViewClosed;

            _blinkTimer = CreateBlinkTimer(protectedOperations, OnCaretBlinkTimer);
        }
コード例 #13
0
        protected virtual void Create(params string[] lines)
        {
            _textView                = CreateTextView(lines);
            _textBuffer              = _textView.TextBuffer;
            _controlCharUtil         = new ControlCharUtil();
            _classificationFormatMap = new Mock <IClassificationFormatMap>(MockBehavior.Strict);
            var typeface = SystemFonts.CaptionFontFamily.GetTypefaces().First();
            var textFormattingProperties = TextFormattingRunProperties.CreateTextFormattingRunProperties(typeface, 10.0, Colors.Black);

            _classificationFormatMap.SetupGet(x => x.DefaultTextProperties).Returns(textFormattingProperties);
            _source = new CharDisplayTaggerSource(
                _textView,
                new Mock <IEditorFormatMap>(MockBehavior.Loose).Object,
                _controlCharUtil,
                _classificationFormatMap.Object);
            _basicTaggerSource = _source;
        }
コード例 #14
0
ファイル: BlockCaret.cs プロジェクト: jaredpar/VsVim
        internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations)
        {
            _textView = textView;
            _editorFormatMap = formatMap;
            _adornmentLayer = layer;
            _protectedOperations = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil = controlCharUtil;

            _textView.LayoutChanged += OnCaretEvent;
            _textView.GotAggregateFocus += OnCaretEvent;
            _textView.LostAggregateFocus += OnCaretEvent;
            _textView.Caret.PositionChanged += OnCaretPositionChanged;
            _textView.Closed += OnTextViewClosed;

            _blinkTimer = CreateBlinkTimer(protectedOperations, OnCaretBlinkTimer);
        }
コード例 #15
0
ファイル: VsVimHost.cs プロジェクト: trigifu/VsVim
        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ISmartIndentationService smartIndentationService,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            IVimApplicationSettings vimApplicationSettings,
            IExtensionAdapterBroker extensionAdapterBroker,
            IProtectedOperations protectedOperations,
            IMarkDisplayUtil markDisplayUtil,
            IControlCharUtil controlCharUtil,
            ICommandDispatcher commandDispatcher,
            SVsServiceProvider serviceProvider,
            IClipboardDevice clipboardDevice)
            : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
        {
            _vsAdapter = adapter;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            _dte                     = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _vsExtensibility         = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
            _textManager             = textManager;
            _sharedService           = sharedServiceFactory.Create();
            _vsMonitorSelection      = serviceProvider.GetService <SVsShellMonitorSelection, IVsMonitorSelection>();
            _vimApplicationSettings  = vimApplicationSettings;
            _smartIndentationService = smartIndentationService;
            _extensionAdapterBroker  = extensionAdapterBroker;
            _runningDocumentTable    = serviceProvider.GetService <SVsRunningDocumentTable, IVsRunningDocumentTable>();
            _vsShell                 = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            _protectedOperations     = protectedOperations;
            _commandDispatcher       = commandDispatcher;
            _clipboardDevice         = clipboardDevice;

            _vsMonitorSelection.AdviseSelectionEvents(this, out uint selectionCookie);
            _runningDocumentTable.AdviseRunningDocTableEvents(this, out uint runningDocumentTableCookie);

            InitOutputPane();

            _settingsSync = new SettingsSync(vimApplicationSettings, markDisplayUtil, controlCharUtil, _clipboardDevice);
            _settingsSync.SyncFromApplicationSettings();
        }
コード例 #16
0
ファイル: BlockCaret.cs プロジェクト: ricksladkey/VsVim
        internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations)
        {
            _textView = textView;
            _editorFormatMap = formatMap;
            _adornmentLayer = layer;
            _protectedOperations = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil = controlCharUtil;

            _textView.LayoutChanged += OnCaretEvent;
            _textView.GotAggregateFocus += OnCaretEvent;
            _textView.LostAggregateFocus += OnCaretEvent;
            _textView.Caret.PositionChanged += OnCaretPositionChanged;
            _textView.Closed += OnTextViewClosed;

            var caretBlinkTime = GetCaretBlinkTime();
            var caretBlinkTimeSpan = new TimeSpan(0, 0, 0, 0, caretBlinkTime ?? Int32.MaxValue);
            _blinkTimer = new DispatcherTimer(
                caretBlinkTimeSpan,
                DispatcherPriority.Normal,
                _protectedOperations.GetProtectedEventHandler(OnCaretBlinkTimer),
                Dispatcher.CurrentDispatcher);
            _blinkTimer.IsEnabled = caretBlinkTime != null;
        }
コード例 #17
0
 internal CharDisplayTaggerSourceFactory(IVim vim, IEditorFormatMapService editorFormatMapService, IControlCharUtil controlCharUtil)
 {
     _editorFormatMapService = editorFormatMapService;
     _vim             = vim;
     _controlCharUtil = controlCharUtil;
 }
コード例 #18
0
ファイル: BlockCaret.cs プロジェクト: Yzzl/VsVim
 internal BlockCaret(IWpfTextView textView, string adornmentLayerName, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations) :
     this(textView, classificationFormatMap, formatMap, textView.GetAdornmentLayer(adornmentLayerName), controlCharUtil, protectedOperations)
 {
 }