UNPKG

@microsoft.azure/autorest.incubator

Version:
19 lines 809 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const initializer_1 = require("../../common/initializer"); const expression_1 = require("../../csharp/code-dom/expression"); /** An c# Attribute that can be placed on methods, classes, members and parameters */ class Attribute extends initializer_1.Initializer { constructor(type, objectIntializer) { super(); this.type = type; this.parameters = new Array(); this.apply(objectIntializer); } get value() { const params = this.parameters.length > 0 ? `(${this.parameters.joinWith(each => expression_1.valueOf(expression_1.toExpression(each)))})` : ''; return `[${this.type.declaration}${params}]`; } } exports.Attribute = Attribute; //# sourceMappingURL=attribute.js.map