System.Runtime.Serialization.XsdDataContractImporter.CanImport C# (CSharp) Метод

CanImport() публичный Метод

public CanImport ( XmlSchemaSet schemas, XmlSchemaElement element ) : bool
schemas System.Xml.Schema.XmlSchemaSet
element System.Xml.Schema.XmlSchemaElement
Результат bool
		public bool CanImport (XmlSchemaSet schemas, XmlSchemaElement element)
		{
			if (schemas == null)
				throw new ArgumentNullException ("schemas");

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

			return CanImport (schemas, element.ElementSchemaType as XmlSchemaComplexType);
		}

Same methods

XsdDataContractImporter::CanImport ( XmlSchemaSet schemas ) : bool
XsdDataContractImporter::CanImport ( XmlSchemaSet schemas, ICollection typeNames ) : bool
XsdDataContractImporter::CanImport ( XmlSchemaSet schemas, XmlQualifiedName typeName ) : bool
XsdDataContractImporter::CanImport ( XmlSchemaSet schemas, XmlSchemaComplexType type ) : 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