System.Runtime.Serialization.SchemaExporter.AddDefaultXmlType C# (CSharp) Method

AddDefaultXmlType() static private method

static private AddDefaultXmlType ( XmlSchemaSet schemas, string localName, string ns ) : void
schemas System.Xml.Schema.XmlSchemaSet
localName string
ns string
return void
        internal static void AddDefaultXmlType(XmlSchemaSet schemas, string localName, string ns)
        {
            XmlSchemaComplexType defaultXmlType = CreateAnyType();
            defaultXmlType.Name = localName;
            XmlSchema schema = SchemaHelper.GetSchema(ns, schemas);
            schema.Items.Add(defaultXmlType);
            schemas.Reprocess(schema);
        }

Usage Example

コード例 #1
0
        public static void AddDefaultSchema(XmlSchemaSet schemas, XmlQualifiedName typeQName)
        {
            ArgumentNullException.ThrowIfNull(schemas);
            ArgumentNullException.ThrowIfNull(typeQName);

            SchemaExporter.AddDefaultXmlType(schemas, typeQName.Name, typeQName.Namespace);
        }
All Usage Examples Of System.Runtime.Serialization.SchemaExporter::AddDefaultXmlType