Exemplo n.º 1
0
 public MetadataNamedArgument(ISymbolInternal entity, Cci.ITypeReference type, Cci.IMetadataExpression value)
 {
     // entity must be one of INamedEntity or IFieldDefinition or IPropertyDefinition
     _entity = entity;
     _type   = type;
     _value  = value;
 }
Exemplo n.º 2
0
 public MetadataNamedArgument(ISymbol entity, Cci.ITypeReference type, Cci.IMetadataExpression value)
 {
     // entity must be one of INamedEntity or IFieldDefinition or IPropertyDefinition
     this.entity = entity;
     this.type = type;
     this.value = value;
 }
        private MetadataCreateArray CreateMetadataArray(TypedConstant argument, Microsoft.CodeAnalysis.Emit.Context context)
        {
            Debug.Assert(!argument.Values.IsDefault);
            var values    = argument.Values;
            var arrayType = Emit.PEModuleBuilder.Translate((ArrayTypeSymbol)argument.Type);

            if (values.Length == 0)
            {
                return(new MetadataCreateArray(arrayType,
                                               arrayType.GetElementType(context),
                                               ImmutableArray <Cci.IMetadataExpression> .Empty));
            }

            var metadataExprs = new Cci.IMetadataExpression[values.Length];

            for (int i = 0; i < values.Length; i++)
            {
                metadataExprs[i] = CreateMetadataExpression(values[i], context);
            }

            return(new MetadataCreateArray(arrayType,
                                           arrayType.GetElementType(context),
                                           metadataExprs.AsImmutableOrNull()));
        }
Exemplo n.º 4
0
 public HexPropertyMetadataNamedArgument(Cci.ITypeReference type, Cci.IMetadataExpression value)
 {
     this.type  = type;
     this.value = value;
 }
Exemplo n.º 5
0
 public HexPropertyMetadataNamedArgument(Cci.ITypeReference type, Cci.IMetadataExpression value)
 {
     this.type = type;
     this.value = value;
 }
Exemplo n.º 6
0
        private MetadataCreateArray CreateMetadataArray(TypedConstant argument, Microsoft.CodeAnalysis.Emit.Context context)
        {
            Debug.Assert(!argument.Values.IsDefault);
            var values = argument.Values;
            var arrayType = Emit.PEModuleBuilder.Translate((ArrayTypeSymbol)argument.Type);

            if (values.Length == 0)
            {
                return new MetadataCreateArray(arrayType,
                                               arrayType.GetElementType(context),
                                               ImmutableArray<Cci.IMetadataExpression>.Empty);
            }

            var metadataExprs = new Cci.IMetadataExpression[values.Length];
            for (int i = 0; i < values.Length; i++)
            {
                metadataExprs[i] = CreateMetadataExpression(values[i], context);
            }

            return new MetadataCreateArray(arrayType,
                                           arrayType.GetElementType(context),
                                           metadataExprs.AsImmutableOrNull());
        }