当前位置: 首页>>代码示例>>C#>>正文


C# Inline.GetValue方法代码示例

本文整理汇总了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; 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:31,代码来源:TextRangeEdit.cs

示例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);
                } 
            }
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:17,代码来源:TextRangeEdit.cs

示例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);
        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:14,代码来源:TextRangeEdit.cs

示例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;
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:33,代码来源:TextRangeEdit.cs


注:本文中的System.Windows.Documents.Inline.GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。