Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ RemoveRecursive()

bool System.Xml.Schema.XmlSchemaSet.RemoveRecursive ( XmlSchema schemaToRemove)
inline

Definition at line 372 of file XmlSchemaSet.cs.

373 {
374 if (schemaToRemove == null)
375 {
376 throw new ArgumentNullException("schemaToRemove");
377 }
378 if (!_schemas.ContainsKey(schemaToRemove.SchemaId))
379 {
380 return false;
381 }
383 {
384 if (_schemas.ContainsKey(schemaToRemove.SchemaId))
385 {
386 Hashtable hashtable = new Hashtable();
388 for (int i = 0; i < schemaToRemove.ImportedNamespaces.Count; i++)
389 {
390 string text = (string)schemaToRemove.ImportedNamespaces[i];
391 if (hashtable[text] == null)
392 {
393 hashtable.Add(text, text);
394 }
395 }
397 XmlSchema xmlSchema;
398 for (int j = 0; j < _schemas.Count; j++)
399 {
400 xmlSchema = (XmlSchema)_schemas.GetByIndex(j);
401 if (xmlSchema != schemaToRemove && !schemaToRemove.ImportedSchemas.Contains(xmlSchema))
402 {
404 }
405 }
406 xmlSchema = null;
407 for (int k = 0; k < arrayList.Count; k++)
408 {
409 xmlSchema = (XmlSchema)arrayList[k];
410 if (xmlSchema.ImportedNamespaces.Count <= 0)
411 {
412 continue;
413 }
414 foreach (string key in hashtable.Keys)
415 {
416 if (xmlSchema.ImportedNamespaces.Contains(key))
417 {
418 SendValidationEvent(new XmlSchemaException(System.SR.Sch_SchemaNotRemoved, string.Empty), XmlSeverityType.Warning);
419 return false;
420 }
421 }
422 }
424 for (int l = 0; l < schemaToRemove.ImportedSchemas.Count; l++)
425 {
426 XmlSchema schema = (XmlSchema)schemaToRemove.ImportedSchemas[l];
428 }
429 return true;
430 }
431 }
432 return false;
433 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
virtual ICollection Keys
Definition Hashtable.cs:532
virtual void Add(object key, object? value)
Definition Hashtable.cs:676
virtual ? object GetByIndex(int index)
virtual bool ContainsKey(object key)
static string Sch_SchemaNotRemoved
Definition SR.cs:1162
Definition SR.cs:7
string GetTargetNamespace(XmlSchema schema)
readonly SortedList _schemas
void SendValidationEvent(XmlSchemaException e, XmlSeverityType severity)

References System.Xml.Schema.XmlSchemaSet._schemas, System.Collections.Hashtable.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), System.Collections.SortedList.ContainsKey(), System.Collections.SortedList.Count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Collections.SortedList.GetByIndex(), System.Xml.Schema.XmlSchemaSet.GetTargetNamespace(), System.Xml.Schema.XmlSchemaSet.InternalSyncObject, System.key, System.Collections.Hashtable.Keys, System.Xml.Remove, System.SR.Sch_SchemaNotRemoved, System.Xml.Schema.XmlSchemaSet.SendValidationEvent(), and System.text.

Referenced by System.Xml.Schema.XmlSchemaSet.Add(), and System.Xml.Schema.XmlSchemaValidator.AddSchema().