/// <summary> /// Copy this to <paramref name="other"/> /// </summary> /// <param name="other">Other instance</param> /// <returns></returns> public TextViewCreatorOptions CopyTo(TextViewCreatorOptions other) { if (other == null) throw new ArgumentNullException(nameof(other)); other.MenuGuid = MenuGuid; other.CreateGuidObjects = CreateGuidObjects; other.EnableUndoHistory = EnableUndoHistory; return other; }
/// <summary> /// Copy this to <paramref name="other"/> /// </summary> /// <param name="other">Other instance</param> /// <returns></returns> public TextViewCreatorOptions CopyTo(TextViewCreatorOptions other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } other.MenuGuid = MenuGuid; other.CreateGuidObjects = CreateGuidObjects; return(other); }
IDsWpfTextView CreateTextViewImpl(ITextViewModel textViewModel, ITextViewRoleSet roles, IEditorOptions parentOptions, TextViewCreatorOptions options) { var wpfTextView = new WpfTextView(textViewModel, roles, parentOptions, editorOptionsFactoryService, commandService, smartIndentationService, formattedTextSourceFactoryService, viewClassifierAggregatorService, textAndAdornmentSequencerFactoryService, classificationFormatMapService, editorFormatMapService, adornmentLayerDefinitionService, lineTransformProviderService, spaceReservationStackProvider, wpfTextViewConnectionListenerServiceProvider, bufferGraphFactoryService, wpfTextViewCreationListeners); if (options?.MenuGuid != null) { var guidObjectsProvider = new GuidObjectsProvider(wpfTextView, options?.CreateGuidObjects); menuService.InitializeContextMenu(wpfTextView.VisualElement, options.MenuGuid.Value, guidObjectsProvider, new ContextMenuInitializer(wpfTextView)); } if (options?.EnableUndoHistory != false) textViewUndoManagerProvider.Value.GetTextViewUndoManager(wpfTextView); TextViewCreated?.Invoke(this, new TextViewCreatedEventArgs(wpfTextView)); return wpfTextView; }
public IDsWpfTextView CreateTextView(ITextViewModel viewModel, ITextViewRoleSet roles, IEditorOptions parentOptions, TextViewCreatorOptions options) { if (viewModel == null) throw new ArgumentNullException(nameof(viewModel)); if (roles == null) throw new ArgumentNullException(nameof(roles)); if (parentOptions == null) throw new ArgumentNullException(nameof(parentOptions)); return CreateTextViewImpl(viewModel, roles, parentOptions, options); }
public IDsWpfTextView CreateTextView(ITextBuffer textBuffer, ITextViewRoleSet roles, IEditorOptions parentOptions, TextViewCreatorOptions options) { if (textBuffer == null) throw new ArgumentNullException(nameof(textBuffer)); if (roles == null) throw new ArgumentNullException(nameof(roles)); if (parentOptions == null) throw new ArgumentNullException(nameof(parentOptions)); return CreateTextView(new TextDataModel(textBuffer), roles, parentOptions, options); }
public IDsWpfTextView CreateTextView(ITextBuffer textBuffer, ITextViewRoleSet roles, TextViewCreatorOptions options) { if (textBuffer == null) throw new ArgumentNullException(nameof(textBuffer)); if (roles == null) throw new ArgumentNullException(nameof(roles)); return CreateTextView(new TextDataModel(textBuffer), roles, editorOptionsFactoryService.GlobalOptions, options); }
public IDsWpfTextView CreateTextView(TextViewCreatorOptions options) => CreateTextView(textBufferFactoryService.CreateTextBuffer(), DefaultRoles, options);