本文整理汇总了C#中ICSharpCode.AvalonEdit.Document.TextDocument.GetRequiredService方法的典型用法代码示例。如果您正苦于以下问题:C# TextDocument.GetRequiredService方法的具体用法?C# TextDocument.GetRequiredService怎么用?C# TextDocument.GetRequiredService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.AvalonEdit.Document.TextDocument
的用法示例。
在下文中一共展示了TextDocument.GetRequiredService方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CodeEditor
public CodeEditor()
{
CodeEditorOptions.Instance.PropertyChanged += CodeEditorOptions_Instance_PropertyChanged;
CustomizedHighlightingColor.ActiveColorsChanged += CustomizedHighlightingColor_ActiveColorsChanged;
SD.ParserService.ParseInformationUpdated += ParserServiceParseInformationUpdated;
this.FlowDirection = FlowDirection.LeftToRight; // code editing is always left-to-right
this.document = new TextDocument();
var documentServiceContainer = document.GetRequiredService<IServiceContainer>();
textMarkerService = new TextMarkerService(document);
documentServiceContainer.AddService(typeof(ITextMarkerService), textMarkerService);
iconBarManager = new IconBarManager();
documentServiceContainer.AddService(typeof(IBookmarkMargin), iconBarManager);
if (CodeEditorOptions.Instance.EnableChangeMarkerMargin) {
changeWatcher = new DefaultChangeWatcher();
}
primaryTextEditor = CreateTextEditor();
primaryTextEditorAdapter = (CodeEditorAdapter)primaryTextEditor.TextArea.GetService(typeof(ITextEditor));
Debug.Assert(primaryTextEditorAdapter != null);
this.ColumnDefinitions.Add(new ColumnDefinition());
this.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star), MinHeight = minRowHeight });
SetRow(primaryTextEditor, 1);
this.Children.Add(primaryTextEditor);
}