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

CanImport() public method

public CanImport ( XmlSchemaSet schemas, ICollection typeNames ) : bool
schemas System.Xml.Schema.XmlSchemaSet
typeNames ICollection
return bool
		public bool CanImport (XmlSchemaSet schemas, ICollection<XmlQualifiedName> typeNames)
		{
			if (schemas == null)
				throw new ArgumentNullException ("schemas");
			if (typeNames == null)
				throw new ArgumentNullException ("typeNames");

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

			foreach (var name in typeNames)
				if (!CanImport (schemas, name))
					return false;
			return true;
		}

Same methods

XsdDataContractImporter::CanImport ( XmlSchemaSet schemas ) : 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