コード例 #1
0
        private IProperty ConvertPropertyKey(IProperty propertyKey, IPlatformMetadata targetPlatformMetadata)
        {
            ITypeId typeId = (ITypeId)propertyKey.DeclaringType;

            if (typeId.Equals((object)PlatformTypes.TextElement))
            {
                typeId = PlatformTypes.Inline;
            }
            ITypeId   type      = (ITypeId)PlatformTypeHelper.ConvertTypeId(typeId, targetPlatformMetadata);
            IProperty property1 = type.GetMember(propertyKey.MemberType, propertyKey.Name, (MemberAccessTypes)(propertyKey.ReadAccess | propertyKey.WriteAccess)) as IProperty;

            if (property1 == null && targetPlatformMetadata.IsCapabilitySet(PlatformCapability.SupportsProxyProperties))
            {
                IEnumerable <IProperty> proxyProperties = targetPlatformMetadata.GetProxyProperties(this.StandaloneWpfDocumentContext.TypeResolver);
                if (proxyProperties != null)
                {
                    string name = propertyKey.Name;
                    foreach (IProperty property2 in proxyProperties)
                    {
                        if (name == property2.Name && property2.DeclaringType.IsAssignableFrom(type))
                        {
                            property1 = property2;
                            break;
                        }
                    }
                }
            }
            return(property1);
        }
コード例 #2
0
 private static bool IsComplexProperty(IPlatformMetadata platformMetadata, IProperty property)
 {
     return(property.Equals((object)RichTextBoxRangeElement.TextElementForegroundProperty) || property.Equals((object)RichTextBoxRangeElement.TextElementBackgroundProperty) || property.Equals((object)RichTextBoxRangeElement.PaddingPropertyId) || !platformMetadata.IsCapabilitySet(PlatformCapability.SupportsTextElementProperties) && (property.Equals((object)RichTextBoxRangeElement.ForegroundProperty) || property.Equals((object)RichTextBoxRangeElement.BackgroundProperty)));
 }