本文整理匯總了C#中System.Windows.Documents.Span.GetValue方法的典型用法代碼示例。如果您正苦於以下問題:C# Span.GetValue方法的具體用法?C# Span.GetValue怎麽用?C# Span.GetValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Documents.Span
的用法示例。
在下文中一共展示了Span.GetValue方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TransferNonFormattingInlineProperties
// When source span has only character formatting properties, returns null.
// Otherwise, when source span has at least one non-formatting character property (such as FlowDirection),
// this helper returns a Span element preserving only such properties from source span.
private static Span TransferNonFormattingInlineProperties(Span source)
{
Span span = null;
DependencyProperty[] nonFormattingCharacterProperties = TextSchema.GetNonFormattingCharacterProperties();
for (int i = 0; i < nonFormattingCharacterProperties.Length; i++)
{
object value = source.GetValue(nonFormattingCharacterProperties[i]);
object outerContextValue = ((ITextPointer)source.ElementStart).GetValue(nonFormattingCharacterProperties[i]);
if (!TextSchema.ValuesAreEqual(value, outerContextValue))
{
if (span == null)
{
span = new Span();
}
span.SetValue(nonFormattingCharacterProperties[i], value);
}
}
return span;
}