本文整理汇总了C#中System.Windows.Documents.Inline.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Inline.GetValue方法的具体用法?C# Inline.GetValue怎么用?C# Inline.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.Inline
的用法示例。
在下文中一共展示了Inline.GetValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InheritablePropertiesAreEqual
// Compares a set of inheritable properties taken from two objects
private static bool InheritablePropertiesAreEqual(Inline firstInline, Inline secondInline)
{
Invariant.Assert(firstInline != null, "null check: firstInline");
Invariant.Assert(secondInline != null, "null check: secondInline");
// Compare inheritable properties
DependencyProperty[] inheritableProperties = TextSchema.GetInheritableProperties(typeof(Inline));
for (int i = 0; i < inheritableProperties.Length; i++)
{
DependencyProperty property = inheritableProperties[i];
if (TextSchema.IsStructuralCharacterProperty(property))
{
if (firstInline.ReadLocalValue(property) != DependencyProperty.UnsetValue ||
secondInline.ReadLocalValue(property) != DependencyProperty.UnsetValue)
{
return false;
}
}
else
{
if (!TextSchema.ValuesAreEqual(firstInline.GetValue(property), secondInline.GetValue(property)))
{
return false;
}
}
}
return true;
}
示例2: TransferStructuralProperties
// Copies all structural properties from source (clearing the property) to destination.
private static void TransferStructuralProperties(Inline source, Inline destination)
{
bool sourceIsChild = (source.Parent == destination);
for (int i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++)
{
DependencyProperty property = TextSchema.StructuralCharacterProperties[i];
if ((sourceIsChild && HasLocalInheritableStructuralPropertyValue(source)) ||
(!sourceIsChild && HasLocalStructuralPropertyValue(source)))
{
object value = source.GetValue(property);
source.ClearValue(property);
destination.SetValue(property, value);
}
}
}
示例3: HasLocalInheritableStructuralPropertyValue
// Returns true if an inline has one or more structural local property values.
private static bool HasLocalInheritableStructuralPropertyValue(Inline inline)
{
int i;
for (i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++)
{
DependencyProperty inheritableProperty = TextSchema.StructuralCharacterProperties[i];
if (!TextSchema.ValuesAreEqual(inline.GetValue(inheritableProperty), inline.Parent.GetValue(inheritableProperty)))
break;
}
return (i < TextSchema.StructuralCharacterProperties.Length);
}
示例4: CharacterPropertiesAreEqual
// Compares all character formatting properties for two elements.
// Returns true if all known properties have equal values, false otherwise.
// Note that only statically known character formatting properties
// are taken into account. We intentionally ignore all other properties,
// because TextEditor is not aware (in general) about their semantics,
// and considers unsafe to duplicate them freely.
// Ignorance means deletion, which is considered as safer approach.
private static bool CharacterPropertiesAreEqual(Inline firstElement, Inline secondElement)
{
Invariant.Assert(firstElement != null, "null check: firstElement");
if (secondElement == null)
{
return false;
}
DependencyProperty[] noninheritableProperties = TextSchema.GetNoninheritableProperties(typeof(Span));
for (int i = 0; i < noninheritableProperties.Length; i++)
{
DependencyProperty property = noninheritableProperties[i];
if (!TextSchema.ValuesAreEqual(firstElement.GetValue(property), secondElement.GetValue(property)))
{
return false;
}
}
if (!InheritablePropertiesAreEqual(firstElement, secondElement))
{
return false;
}
return true;
}