private bool AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item)
{
if (qname.Name.Length != 0)
{
XmlSchemaObject obj2 = table[qname];
if (obj2 != null)
{
if ((obj2 == item) || (obj2.SourceUri == item.SourceUri))
{
return(true);
}
string res = string.Empty;
if (item is XmlSchemaComplexType)
{
res = "Sch_DupComplexType";
}
else if (item is XmlSchemaSimpleType)
{
res = "Sch_DupSimpleType";
}
else if (item is XmlSchemaElement)
{
res = "Sch_DupGlobalElement";
}
else if (item is XmlSchemaAttribute)
{
if (qname.Namespace == "http://www.w3.org/XML/1998/namespace")
{
XmlSchemaObject obj3 = Preprocessor.GetBuildInSchema().Attributes[qname];
if (obj2 == obj3)
{
table.Insert(qname, item);
return(true);
}
if (item == obj3)
{
return(true);
}
}
res = "Sch_DupGlobalAttribute";
}
this.SendValidationEvent(new XmlSchemaException(res, qname.ToString()), XmlSeverityType.Error);
return(false);
}
table.Add(qname, item);
}
return(true);
}