예제 #1
0
        private short GetExtensionValueId(BamlExtensionValue extensionValue)
        {
            switch (extensionValue.ValueType)
            {
            case BamlExtensionValueType.Property:
                return(GetPropertyId(((BamlExtensionPropertyValue)extensionValue).Value));

            case BamlExtensionValueType.Resource:
            {
                var resourceExtensionValue = (BamlExtensionResourceValue)extensionValue;

                short valueId = (short)resourceExtensionValue.Value;

                if (!resourceExtensionValue.IsKey)
                {
                    valueId += 0xe8;
                }

                return((short)-valueId);
            }

            case BamlExtensionValueType.String:
                return(GetStringId(((BamlExtensionStringValue)extensionValue).Value));

            case BamlExtensionValueType.Type:
                return(GetTypeId(((BamlExtensionTypeValue)extensionValue).Value));

            default:
                throw new NotImplementedException();
            }
        }
예제 #2
0
 public BamlExtension(BamlExtensionType type, BamlExtensionValue value)
 {
     _type  = type;
     _value = value;
 }
예제 #3
0
 public BamlOptimizedStaticResource(BamlExtensionValue value, BamlOptimizedStaticResourceFlags flags)
 {
     _value = value;
     _flags = flags;
 }