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

◆ Add() [6/6]

void System.Xml.Schema.XmlSchemaSet.Add ( XmlSchemaSet schemas)
inline

Definition at line 274 of file XmlSchemaSet.cs.

275 {
276 if (schemas == null)
277 {
278 throw new ArgumentNullException("schemas");
279 }
280 if (this == schemas)
281 {
282 return;
283 }
284 bool lockTaken = false;
285 bool lockTaken2 = false;
286 try
287 {
288 SpinWait spinWait = default(SpinWait);
289 while (true)
290 {
292 if (lockTaken)
293 {
294 Monitor.TryEnter(schemas.InternalSyncObject, ref lockTaken2);
295 if (lockTaken2)
296 {
297 break;
298 }
300 lockTaken = false;
301 spinWait.SpinOnce();
302 }
303 }
304 if (schemas.IsCompiled)
305 {
306 CopyFromCompiledSet(schemas);
307 return;
308 }
309 bool flag = false;
310 string text = null;
311 foreach (XmlSchema value in schemas.SortedSchemas.Values)
312 {
313 text = value.TargetNamespace;
314 if (text == null)
315 {
316 text = string.Empty;
317 }
318 if (!_schemas.ContainsKey(value.SchemaId) && FindSchemaByNSAndUrl(value.BaseUri, text, null) == null)
319 {
320 XmlSchema xmlSchema2 = Add(value.TargetNamespace, value);
321 if (xmlSchema2 == null)
322 {
323 flag = true;
324 break;
325 }
326 }
327 }
328 if (!flag)
329 {
330 return;
331 }
332 foreach (XmlSchema value2 in schemas.SortedSchemas.Values)
333 {
334 _schemas.Remove(value2.SchemaId);
336 }
337 }
338 finally
339 {
340 if (lockTaken)
341 {
343 }
344 if (lockTaken2)
345 {
346 Monitor.Exit(schemas.InternalSyncObject);
347 }
348 }
349 }
virtual void Remove(object key)
virtual void Remove(object key)
virtual bool ContainsKey(object key)
static void Exit(object obj)
static bool TryEnter(object obj)
Definition Monitor.cs:36
XmlSchema FindSchemaByNSAndUrl(Uri schemaUri, string ns, DictionaryEntry[] locationsTable)
readonly Hashtable _schemaLocations
readonly SortedList _schemas
void CopyFromCompiledSet(XmlSchemaSet otherSet)

References System.Xml.Schema.XmlSchemaSet._schemaLocations, System.Xml.Schema.XmlSchemaSet._schemas, System.Add, System.Collections.SortedList.ContainsKey(), System.Xml.Schema.XmlSchemaSet.CopyFromCompiledSet(), System.Threading.Monitor.Exit(), System.Xml.Schema.XmlSchemaSet.FindSchemaByNSAndUrl(), System.Xml.Schema.XmlSchemaSet.InternalSyncObject, System.Xml.Schema.XmlSchemaSet.IsCompiled, System.Collections.SortedList.Remove(), System.Collections.Hashtable.Remove(), System.Xml.Schema.XmlSchemaSet.SortedSchemas, System.text, System.Threading.Monitor.TryEnter(), System.value, and System.Collections.SortedList.Values.