Example #1
0
        public void WriteXmlSecurityDeclaration(SecurityDeclaration declaration)
        {
            string xmlSecurityDeclaration = SignatureWriter.GetXmlSecurityDeclaration(declaration);

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

            base.WriteUInt16((ushort)namedArgumentCount);
            if (namedArgumentCount == 0)
            {
                return;
            }
            this.WriteICustomAttributeNamedArguments(attribute);
        }
Example #3
0
        private void WriteSecurityAttribute(SecurityAttribute attribute)
        {
            this.WriteTypeReference(attribute.AttributeType);
            int namedArgumentCount = SignatureWriter.GetNamedArgumentCount(attribute);

            if (namedArgumentCount == 0)
            {
                base.WriteCompressedUInt32(1);
                base.WriteCompressedUInt32(0);
                return;
            }
            SignatureWriter signatureWriter = new SignatureWriter(this.metadata);

            signatureWriter.WriteCompressedUInt32((uint)namedArgumentCount);
            signatureWriter.WriteICustomAttributeNamedArguments(attribute);
            base.WriteCompressedUInt32((uint)signatureWriter.length);
            base.WriteBytes(signatureWriter);
        }