System.Xml.Schema.XmlSchemaObjectTable.Contains C# (CSharp) Method

Contains() public method

public Contains ( XmlQualifiedName name ) : bool
name System.Xml.XmlQualifiedName
return bool
        public bool Contains(XmlQualifiedName name) {
            return table.ContainsKey(name);
        }

Usage Example

Example #1
1
		public static void AddToTable (XmlSchemaObjectTable table, XmlSchemaObject obj,
			XmlQualifiedName qname, ValidationEventHandler h)
		{
			if (table.Contains (qname)) {
				// FIXME: This logic unexpectedly allows 
				// one redefining item and two or more redefining items.
				// FIXME: redefining item is not simple replacement,
				// but much more complex stuff.
				if (obj.isRedefineChild) {	// take precedence.
					if (obj.redefinedObject != null)
						obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
					else
						obj.redefinedObject = table [qname];
					table.Set (qname, obj);
				}
				else if (table [qname].isRedefineChild) {
					if (table [qname].redefinedObject != null)
						obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
					else
						table [qname].redefinedObject = obj;
					return;	// never add to the table.
				}
				else if (StrictMsCompliant) {
					table.Set (qname, obj);
				}
				else
					obj.error (h, String.Format ("Named item {0} was already contained in the schema object table. {1}",
					                             qname, "Consider setting MONO_STRICT_MS_COMPLIANT to 'yes' to mimic MS implementation."));
			}
			else
				table.Set (qname, obj);
		}
All Usage Examples Of System.Xml.Schema.XmlSchemaObjectTable::Contains