internal ITextUndoHistoryRegistry TextUndoHistoryRegistry = null; // Set via MEF

		public void VsTextViewCreated(IVsTextView textViewAdapter)
		{
			ITextView textView = EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter);
			if (textView == null)
				return;

			var dispatcher = new CommandHandlerDispatcher(textViewAdapter, textView, TextUndoHistoryRegistry,
				new CommentSelectionCommandHandler(),
				new UncommentSelectionCommandHandler(),
				new FormatDocumentCommandHandler()
			);

			textView.Properties.AddProperty(typeof(CommandHandlerDispatcher), dispatcher);
		}
Beispiel #2
0
        internal ITextUndoHistoryRegistry TextUndoHistoryRegistry = null;         // Set via MEF

        public void VsTextViewCreated(IVsTextView textViewAdapter)
        {
            ITextView textView = EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter);

            if (textView == null)
            {
                return;
            }

            var dispatcher = new CommandHandlerDispatcher(textViewAdapter, textView, TextUndoHistoryRegistry,
                                                          new CommentSelectionCommandHandler(),
                                                          new UncommentSelectionCommandHandler(),
                                                          new FormatDocumentCommandHandler()
                                                          );

            textView.Properties.AddProperty(typeof(CommandHandlerDispatcher), dispatcher);
        }