public void WriteXmlSecurityDeclaration(SecurityDeclaration declaration) { string xmlSecurityDeclaration = SignatureWriter.GetXmlSecurityDeclaration(declaration); if (xmlSecurityDeclaration == null) { throw new NotSupportedException(); } base.WriteBytes(Encoding.Unicode.GetBytes(xmlSecurityDeclaration)); }
public void WriteCustomAttributeNamedArguments(CustomAttribute attribute) { int namedArgumentCount = SignatureWriter.GetNamedArgumentCount(attribute); base.WriteUInt16((ushort)namedArgumentCount); if (namedArgumentCount == 0) { return; } this.WriteICustomAttributeNamedArguments(attribute); }
private void WriteSecurityAttribute(SecurityAttribute attribute) { this.WriteTypeReference(attribute.AttributeType); int namedArgumentCount = SignatureWriter.GetNamedArgumentCount(attribute); if (namedArgumentCount == 0) { base.WriteCompressedUInt32(1u); base.WriteCompressedUInt32(0u); return; } SignatureWriter signatureWriter = new SignatureWriter(this.metadata); signatureWriter.WriteCompressedUInt32((uint)namedArgumentCount); signatureWriter.WriteICustomAttributeNamedArguments(attribute); base.WriteCompressedUInt32((uint)signatureWriter.length); base.WriteBytes(signatureWriter); }