コード例 #1
0
 public BamlPropertyWithExtension(bool isValueType, bool isStaticType, BamlExtension extension, IBamlProperty declaringProperty)
 {
     _isValueType       = isValueType;
     _isStaticType      = isStaticType;
     _extension         = extension;
     _declaringProperty = declaringProperty;
 }
コード例 #2
0
        private short GetPropertyId(IBamlProperty property)
        {
            switch (property.Kind)
            {
            case BamlPropertyKind.Declaration:
            {
                short propertyId;
                if (!_propertyToID.TryGetValue((BamlPropertyInfo)property, out propertyId))
                {
                    throw new BamlException(SR.BamlLoadError);
                }

                return(propertyId);
            }

            case BamlPropertyKind.Known:
            {
                short propertyId = (short)((BamlKnownProperty)property).KnownCode;
                return((short)-propertyId);
            }

            default:
                throw new NotImplementedException();
            }
        }
コード例 #3
0
        public BamlPropertyValueWithProperty(IBamlProperty property)
        {
            _property = property;

            var declaringProperty = property as BamlPropertyInfo;

            if (declaringProperty != null)
            {
                _name = declaringProperty.Name;
                _type = declaringProperty.Type;
            }
        }
コード例 #4
0
        public static MemberNode Resolve(IBamlProperty bamlProperty, Assembly ownerAssembly, bool throwOnFailure = false)
        {
            var property = bamlProperty.Resolve(ownerAssembly);

            if (property == null)
            {
                if (throwOnFailure)
                {
                    throw new ResolveReferenceException(string.Format(Net.SR.PropertyResolveError, bamlProperty.ToString()));
                }

                return(null);
            }

            return(property);
        }
コード例 #5
0
        private static bool IsProperty(IBamlProperty bamlProperty, string name, string typeName, bool ignoreNamespace)
        {
            var bamlPropertyInfo = bamlProperty as BamlPropertyInfo;

            if (bamlPropertyInfo == null)
            {
                return(false);
            }

            if (bamlPropertyInfo.Name != name)
            {
                return(false);
            }

            if (!IsType(bamlPropertyInfo.Type, typeName, ignoreNamespace))
            {
                return(false);
            }

            return(true);
        }
コード例 #6
0
        private static bool IsProperty(IBamlProperty bamlProperty, string name, BamlKnownTypeCode typeCode)
        {
            var bamlPropertyInfo = bamlProperty as BamlPropertyInfo;

            if (bamlPropertyInfo == null)
            {
                return(false);
            }

            if (bamlPropertyInfo.Name != name)
            {
                return(false);
            }

            if (!IsType(bamlPropertyInfo.Type, typeCode))
            {
                return(false);
            }

            return(true);
        }
コード例 #7
0
 public BamlContentProperty(IBamlProperty property)
 {
     _property = property;
 }
コード例 #8
0
 public BamlPropertyArray(IBamlProperty declaringProperty)
 {
     _declaringProperty = declaringProperty;
 }
コード例 #9
0
 private MemberNode Resolve(IBamlProperty bamlProperty)
 {
     return(bamlProperty.Resolve(_assembly));
 }
コード例 #10
0
 public BamlProperty(string value, IBamlProperty declaringProperty)
 {
     _value             = value;
     _declaringProperty = declaringProperty;
 }
コード例 #11
0
 public BamlRoutedEvent(string value, IBamlProperty property)
 {
     _value    = value;
     _property = property;
 }
コード例 #12
0
 public BamlPropertyIList(IBamlProperty declaringProperty)
 {
     _declaringProperty = declaringProperty;
 }
コード例 #13
0
 public BamlPropertyWithConverter(string value, IBamlType converterType, IBamlProperty declaringProperty)
 {
     _value             = value;
     _converterType     = converterType;
     _declaringProperty = declaringProperty;
 }
コード例 #14
0
 public BamlPropertyCustom(bool isValueType, BamlPropertyValue value, IBamlProperty declaringProperty)
 {
     _isValueType       = isValueType;
     _value             = value;
     _declaringProperty = declaringProperty;
 }
コード例 #15
0
 public BamlPropertyIDictionary(IBamlProperty declaringProperty)
 {
     _declaringProperty = declaringProperty;
 }
コード例 #16
0
 public BamlExtensionPropertyValue(IBamlProperty value)
 {
     _value = value;
 }
コード例 #17
0
 public BamlPropertyWithStaticResourceId(short staticResourceId, IBamlProperty declaringProperty)
 {
     _staticResourceId  = staticResourceId;
     _declaringProperty = declaringProperty;
 }
コード例 #18
0
 public BamlPropertyComplex(IBamlProperty declaringProperty)
 {
     _declaringProperty = declaringProperty;
 }
コード例 #19
0
 public BamlPropertyTypeReference(IBamlType value, IBamlProperty declaringProperty)
 {
     _value             = value;
     _declaringProperty = declaringProperty;
 }
コード例 #20
0
 public BamlPropertyStringReference(IBamlString value, IBamlProperty declaringProperty)
 {
     _value             = value;
     _declaringProperty = declaringProperty;
 }