System.Runtime.Serialization.XsdDataContractImporter.CanImport C# (CSharp) Method

CanImport() public method

public CanImport ( XmlSchemaSet schemas ) : bool
schemas System.Xml.Schema.XmlSchemaSet
return bool
		public bool CanImport (XmlSchemaSet schemas)
		{
			if (schemas == null)
				throw new ArgumentNullException ("schemas");

			if (!schemas.IsCompiled)
				schemas.Compile ();

			foreach (XmlSchemaElement xe in schemas.GlobalElements.Values)
				if (!CanImport (schemas, xe))
					return false;
			return true;
		}

Same methods

XsdDataContractImporter::CanImport ( XmlSchemaSet schemas, ICollection typeNames ) : bool
XsdDataContractImporter::CanImport ( XmlSchemaSet schemas, XmlQualifiedName typeName ) : bool
XsdDataContractImporter::CanImport ( XmlSchemaSet schemas, XmlSchemaComplexType type ) : bool
XsdDataContractImporter::CanImport ( XmlSchemaSet schemas, XmlSchemaElement element ) : bool

Usage Example

コード例 #1
0
		void DoCanImport (bool result, params string [] schemaFiles)
		{
			var ccu = new CodeCompileUnit ();
			var xdi = new XsdDataContractImporter (ccu);
			var xss = new XmlSchemaSet ();
			foreach (var schemaFile in schemaFiles)
				xss.Add (null, schemaFile);
			Assert.AreEqual (result, xdi.CanImport (xss));
		}
All Usage Examples Of System.Runtime.Serialization.XsdDataContractImporter::CanImport