System.Xml.Serialization.XmlCodeExporter.ExportAnyElement C# (CSharp) Method

ExportAnyElement() public method

public ExportAnyElement ( CodeAttributeDeclarationCollection metadata, string name, string ns, int sequenceId ) : void
metadata System.CodeDom.CodeAttributeDeclarationCollection
name string
ns string
sequenceId int
return void
        void ExportAnyElement(CodeAttributeDeclarationCollection metadata, string name, string ns, int sequenceId) {
            CodeAttributeDeclaration attribute = new CodeAttributeDeclaration(typeof(XmlAnyElementAttribute).FullName);
            if (name != null && name.Length > 0) {
                attribute.Arguments.Add(new CodeAttributeArgument("Name", new CodePrimitiveExpression(name)));
            }
            if (ns != null && ns.Length > 0) {
                attribute.Arguments.Add(new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(ns)));
            }
            if (sequenceId >= 0) {
                attribute.Arguments.Add(new CodeAttributeArgument("Order", new CodePrimitiveExpression(sequenceId)));
            }
            metadata.Add(attribute);
        }