System.Xml.Serialization.XmlSchemaExporter.AddXmlnsAnnotation C# (CSharp) Method

AddXmlnsAnnotation() private method

private AddXmlnsAnnotation ( XmlSchemaComplexType type, string xmlnsMemberName ) : void
type System.Xml.Schema.XmlSchemaComplexType
xmlnsMemberName string
return void
        private void AddXmlnsAnnotation(XmlSchemaComplexType type, string xmlnsMemberName)
        {
            XmlSchemaAnnotation annotation = new XmlSchemaAnnotation();
            XmlSchemaAppInfo appinfo = new XmlSchemaAppInfo();

            XmlDocument d = new XmlDocument();
            XmlElement e = d.CreateElement("keepNamespaceDeclarations");
            if (xmlnsMemberName != null)
                e.InsertBefore(d.CreateTextNode(xmlnsMemberName), null);
            appinfo.Markup = new XmlNode[] { e };
            annotation.Items.Add(appinfo);
            type.Annotation = annotation;
        }
    }