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

◆ Compile()

void System.Xml.Schema.XmlSchemaSet.Compile ( )
inline

Definition at line 453 of file XmlSchemaSet.cs.

454 {
455 if (_isCompiled)
456 {
457 return;
458 }
459 if (_schemas.Count == 0)
460 {
461 ClearTables();
462 _cachedCompiledInfo = new SchemaInfo();
463 _isCompiled = true;
464 _compileAll = false;
465 return;
466 }
468 {
469 if (_isCompiled)
470 {
471 return;
472 }
474 SchemaInfo schemaInfo = new SchemaInfo();
475 int i = 0;
476 if (!_compileAll)
477 {
478 compiler.ImportAllCompiledSchemas(this);
479 }
480 try
481 {
482 XmlSchema buildInSchema = Preprocessor.GetBuildInSchema();
483 for (i = 0; i < _schemas.Count; i++)
484 {
485 XmlSchema xmlSchema = (XmlSchema)_schemas.GetByIndex(i);
487 if (!xmlSchema.IsPreprocessed)
488 {
489 SendValidationEvent(new XmlSchemaException(System.SR.Sch_SchemaNotPreprocessed, string.Empty), XmlSeverityType.Error);
490 _isCompiled = false;
491 return;
492 }
493 if (xmlSchema.IsCompiledBySet)
494 {
495 if (!_compileAll)
496 {
497 continue;
498 }
500 {
501 compiler.Prepare(xmlSchema, cleanup: false);
502 continue;
503 }
504 }
505 compiler.Prepare(xmlSchema, cleanup: true);
506 }
507 _isCompiled = compiler.Execute(this, schemaInfo);
508 if (_isCompiled)
509 {
510 if (!_compileAll)
511 {
513 }
514 _compileAll = false;
515 _cachedCompiledInfo = schemaInfo;
516 }
517 }
518 finally
519 {
520 if (i == _schemas.Count)
521 {
522 i--;
523 }
524 for (int num = i; num >= 0; num--)
525 {
526 XmlSchema xmlSchema2 = (XmlSchema)_schemas.GetByIndex(num);
527 if (xmlSchema2 == Preprocessor.GetBuildInSchema())
528 {
530 }
531 else
532 {
535 }
536 }
537 }
538 }
539 }
void Add(TKey key, TValue value)
virtual ? object GetByIndex(int index)
static string Sch_SchemaNotPreprocessed
Definition SR.cs:1160
Definition SR.cs:7
static void Exit(object obj)
static void Enter(object obj)
readonly XmlNameTable _nameTable
XmlSchemaCompilationSettings _compilationSettings
readonly SortedList _schemas
ValidationEventHandler _eventHandler
void SendValidationEvent(XmlSchemaException e, XmlSeverityType severity)

References System.Xml.Schema.XmlSchemaSet._cachedCompiledInfo, System.Xml.Schema.XmlSchemaSet._compilationSettings, System.Xml.Schema.XmlSchemaSet._compileAll, System.Xml.Schema.XmlSchemaSet._eventHandler, System.Xml.Schema.XmlSchemaSet._isCompiled, System.Xml.Schema.XmlSchemaSet._nameTable, System.Xml.Schema.XmlSchemaSet._schemaForSchema, System.Xml.Schema.XmlSchemaSet._schemas, System.Xml.Schema.SchemaInfo.Add(), System.Xml.Schema.XmlSchemaSet.ClearTables(), System.Collections.SortedList.Count, System.Xml.Dictionary, System.Threading.Monitor.Enter(), System.Threading.Monitor.Exit(), System.Xml.Schema.Preprocessor.GetBuildInSchema(), System.Collections.SortedList.GetByIndex(), System.Xml.Schema.XmlSchemaSet.InternalSyncObject, System.SR.Sch_SchemaNotPreprocessed, and System.Xml.Schema.XmlSchemaSet.SendValidationEvent().

Referenced by System.Xml.Serialization.XmlSchemas.Compile(), System.Xml.Schema.XmlSchemaInference.InferSchema1(), System.Xml.Schema.XmlSchemaValidator.RecompileSchemaSet(), and System.Xml.Serialization.SerializableMapping.RetrieveSerializableSchema().