本文整理汇总了C#中System.Windows.Documents.List.AsReadOnly方法的典型用法代码示例。如果您正苦于以下问题:C# List.AsReadOnly方法的具体用法?C# List.AsReadOnly怎么用?C# List.AsReadOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.List
的用法示例。
在下文中一共展示了List.AsReadOnly方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WpfRichTextBoxTarget
static WpfRichTextBoxTarget()
{
var rules = new List<WpfRichTextBoxRowColoringRule>()
{
new WpfRichTextBoxRowColoringRule("level == LogLevel.Fatal", "Black", "Red", FontStyles.Normal, FontWeights.Bold),
new WpfRichTextBoxRowColoringRule("level == LogLevel.Error", "Black", "Empty", FontStyles.Italic, FontWeights.Bold),
new WpfRichTextBoxRowColoringRule("level == LogLevel.Warn", "Black", "Empty"),
new WpfRichTextBoxRowColoringRule("level == LogLevel.Info", "Black", "Empty"),
new WpfRichTextBoxRowColoringRule("level == LogLevel.Debug", "Black", "Empty"),
new WpfRichTextBoxRowColoringRule("level == LogLevel.Trace", "Black", "Empty"),
};
DefaultRowColoringRules = rules.AsReadOnly();
}
示例2: SetTextLines
internal void SetTextLines(List<TextLine> textLines)
{
this.textLines = textLines.AsReadOnly();
Height = 0;
foreach (TextLine line in textLines)
Height += line.Height;
}
示例3: ConstructVisualElements
internal void ConstructVisualElements(ITextRunConstructionContext context, VisualLineElementGenerator[] generators)
{
Debug.Assert(phase == LifetimePhase.Generating);
foreach (VisualLineElementGenerator g in generators) {
g.StartGeneration(context);
}
elements = new List<VisualLineElement>();
PerformVisualElementConstruction(generators);
foreach (VisualLineElementGenerator g in generators) {
g.FinishGeneration();
}
var globalTextRunProperties = context.GlobalTextRunProperties;
foreach (var element in elements) {
element.SetTextRunProperties(new VisualLineElementTextRunProperties(globalTextRunProperties));
}
this.Elements = elements.AsReadOnly();
CalculateOffsets();
phase = LifetimePhase.Transforming;
}
示例4: ConstructVisualElements
internal void ConstructVisualElements(ITextRunConstructionContext context, VisualLineElementGenerator[] generators)
{
foreach (VisualLineElementGenerator g in generators) {
g.StartGeneration(context);
}
elements = new List<VisualLineElement>();
PerformVisualElementConstruction(generators);
foreach (VisualLineElementGenerator g in generators) {
g.FinishGeneration();
}
this.Elements = elements.AsReadOnly();
CalculateOffsets(context.GlobalTextRunProperties);
}
示例5: ConstructVisualElements
internal void ConstructVisualElements(ITextRunConstructionContext context, VisualLineElementGenerator[] generators)
{
foreach (VisualLineElementGenerator g in generators) {
g.StartGeneration(context);
}
elements = new List<VisualLineElement>();
PerformVisualElementConstruction(generators);
foreach (VisualLineElementGenerator g in generators) {
g.FinishGeneration();
}
// if (FirstDocumentLine.Length != 0)
// elements.Add(new VisualLineText(FirstDocumentLine.Text, FirstDocumentLine.Length));
// //elements.Add(new VisualNewLine(VisualNewLine.NewLineType.Lf));
this.Elements = elements.AsReadOnly();
CalculateOffsets(context.GlobalTextRunProperties);
}