Exemplo n.º 1
0
        public void WriteXmlSecurityDeclaration(SecurityDeclaration declaration)
        {
            string xmlSecurityDeclaration = SignatureWriter.GetXmlSecurityDeclaration(declaration);

            if (xmlSecurityDeclaration == null)
            {
                throw new NotSupportedException();
            }
            base.WriteBytes(Encoding.Unicode.GetBytes(xmlSecurityDeclaration));
        }
Exemplo n.º 2
0
        public void WriteCustomAttributeNamedArguments(CustomAttribute attribute)
        {
            int namedArgumentCount = SignatureWriter.GetNamedArgumentCount(attribute);

            base.WriteUInt16((ushort)namedArgumentCount);
            if (namedArgumentCount == 0)
            {
                return;
            }
            this.WriteICustomAttributeNamedArguments(attribute);
        }
Exemplo n.º 3
0
        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);
        }