本文整理汇总了C#中System.Windows.Controls.TextBlock.SetDefaultTextProperties方法的典型用法代码示例。如果您正苦于以下问题:C# TextBlock.SetDefaultTextProperties方法的具体用法?C# TextBlock.SetDefaultTextProperties怎么用?C# TextBlock.SetDefaultTextProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.TextBlock
的用法示例。
在下文中一共展示了TextBlock.SetDefaultTextProperties方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToTextBlock
public TextBlock ToTextBlock(string text, SyntaxTokenClassification classification) {
var textBlock = new TextBlock { TextWrapping = TextWrapping.Wrap };
var formatMap = _classificationFormatMapService.GetClassificationFormatMap("tooltip");
textBlock.SetDefaultTextProperties(formatMap);
var run = ToRun(text, classification, formatMap);
textBlock.Inlines.Add(run);
return textBlock;
}
示例2: CreateContent
private FrameworkElement CreateContent(string eventName, ClassificationTypeMap classificationTypeMap)
{
var textBlock = new TextBlock { TextWrapping = TextWrapping.NoWrap };
textBlock.SetDefaultTextProperties(classificationTypeMap.ClassificationFormatMapService.GetClassificationFormatMap("tooltip"));
var eventNameRun = new Run(eventName + ";");
eventNameRun.FontWeight = FontWeights.Bold;
textBlock.Inlines.Add(eventNameRun);
var pressTabRun = new Run(CSharpEditorResources.Press_TAB_to_insert);
textBlock.Inlines.Add(pressTabRun);
return textBlock;
}
示例3: ToTextBlock
public static TextBlock ToTextBlock(
this IEnumerable<Inline> inlines,
ClassificationTypeMap typeMap,
string classificationFormatMap = null)
{
classificationFormatMap = classificationFormatMap ?? "tooltip";
var formatMap = typeMap.ClassificationFormatMapService.GetClassificationFormatMap(classificationFormatMap);
var textBlock = new TextBlock { TextWrapping = TextWrapping.Wrap };
textBlock.SetDefaultTextProperties(formatMap);
textBlock.Inlines.AddRange(inlines);
return textBlock;
}
示例4: ToTextBlock
public static TextBlock ToTextBlock(this IEnumerable<SymbolDisplayPart> parts, ClassificationTypeMap typeMap)
{
var result = new TextBlock() { TextWrapping = TextWrapping.Wrap };
var formatMap = typeMap.ClassificationFormatMapService.GetClassificationFormatMap("tooltip");
result.SetDefaultTextProperties(formatMap);
foreach (var part in parts)
{
result.Inlines.Add(part.ToRun(formatMap, typeMap));
}
return result;
}
示例5: Create
public FrameworkElement Create()
{
var documentationTextBlock = new TextBlock()
{
TextWrapping = TextWrapping.Wrap
};
var formatMap = _typeMap.ClassificationFormatMapService.GetClassificationFormatMap("tooltip");
documentationTextBlock.SetDefaultTextProperties(formatMap);
// If we have already computed the symbol documentation by now, update
UpdateDocumentationTextBlock(documentationTextBlock);
return documentationTextBlock;
}
示例6: ToTextBlock
public TextBlock ToTextBlock(SignalTriggerCodeModel codeModel) {
var textBlock = new TextBlock { TextWrapping = TextWrapping.Wrap };
var formatMap = _classificationFormatMapService.GetClassificationFormatMap("tooltip");
textBlock.SetDefaultTextProperties(formatMap);
//var nsRun = ToRun(codeModel.WflNamespace+".", SyntaxTokenClassification.Identifier, formatMap);
//textBlock.Inlines.Add(nsRun);
var typeRun = ToRun(codeModel.TaskCodeModel.WfsTypeName, SyntaxTokenClassification.TaskName, formatMap);
textBlock.Inlines.Add(typeRun);
var methodRun = ToRun("."+ codeModel.TriggerLogicMethodName + "()", SyntaxTokenClassification.Identifier, formatMap);
textBlock.Inlines.Add(methodRun);
return textBlock;
}
示例7: ToTextBlock
public static TextBlock ToTextBlock(
this IEnumerable<Inline> inlines,
ClassificationTypeMap typeMap,
string classificationFormatMap = null,
bool wrap = true)
{
classificationFormatMap = classificationFormatMap ?? "tooltip";
var formatMap = typeMap.ClassificationFormatMapService.GetClassificationFormatMap(classificationFormatMap);
var textBlock = new TextBlock
{
TextWrapping = wrap ? TextWrapping.Wrap : TextWrapping.NoWrap,
TextTrimming = wrap ? TextTrimming.None : TextTrimming.CharacterEllipsis
};
textBlock.SetDefaultTextProperties(formatMap);
textBlock.Inlines.AddRange(inlines);
return textBlock;
}