當前位置: 首頁>>代碼示例>>C#>>正文


C# List.AsReadOnly方法代碼示例

本文整理匯總了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();
        }
開發者ID:WinMustDie,項目名稱:TradingStation,代碼行數:14,代碼來源:WpfRichTextBoxTarget.cs

示例2: SetTextLines

 internal void SetTextLines(List<TextLine> textLines)
 {
     this.textLines = textLines.AsReadOnly();
     Height = 0;
     foreach (TextLine line in textLines)
         Height += line.Height;
 }
開發者ID:eolandezhang,項目名稱:Diagram,代碼行數:7,代碼來源:VisualLine.cs

示例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;
        }
開發者ID:eolandezhang,項目名稱:Diagram,代碼行數:20,代碼來源:VisualLine.cs

示例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);
        }
開發者ID:g4idrijs,項目名稱:UltraDemo,代碼行數:14,代碼來源:VisualLine.cs

示例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);
		}
開發者ID:tiwariritesh7,項目名稱:devdefined-tools,代碼行數:17,代碼來源:VisualLine.cs


注:本文中的System.Windows.Documents.List.AsReadOnly方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。