System.ServiceModel.Discovery.ResolveCriteria.BuildSchema C# (CSharp) Метод

BuildSchema() статический приватный Метод

static private BuildSchema ( System.ServiceModel.Discovery.DiscoveryVersion version ) : XmlSchema
version System.ServiceModel.Discovery.DiscoveryVersion
Результат System.Xml.Schema.XmlSchema
		internal static XmlSchema BuildSchema (DiscoveryVersion version)
		{
			var schema = new XmlSchema () { TargetNamespace = version.Namespace };
			string addrNS = "http://www.w3.org/2005/08/addressing";

			var anyAttr = new XmlSchemaAnyAttribute () { Namespace = "##other", ProcessContents = XmlSchemaContentProcessing.Lax };

			var resolvePart = new XmlSchemaSequence ();
			resolvePart.Items.Add (new XmlSchemaElement () { RefName = new XmlQualifiedName ("EndpointReference", addrNS), MinOccurs = 0 });
			resolvePart.Items.Add (new XmlSchemaAny () { MinOccurs = 0, MaxOccursString = "unbounded", Namespace = "##other", ProcessContents = XmlSchemaContentProcessing.Lax });
			var ct = new XmlSchemaComplexType () { Name = "ResolveType", Particle = resolvePart, AnyAttribute = anyAttr };

			schema.Includes.Add (new XmlSchemaImport () { Namespace = addrNS });
			schema.Items.Add (ct);

			return schema;
		}
	}