The Labs \ Source Viewer \ SSCLI \ System.Xml \ DiagnosticsSwitches

  1. //------------------------------------------------------------------------------
  2. // <copyright file="DiagnosticsSwitches.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.Xml
  16. {
  17.     using System.Diagnostics;
  18.    
  19.     #if DEBUG
  20.     public static class DiagnosticsSwitches
  21.     {
  22.         #else
  23.         static internal class DiagnosticsSwitches
  24.         {
  25.             #endif
  26.             private static BooleanSwitch xmlSchemaContentModel;
  27.             private static TraceSwitch xmlSchema;
  28.             private static BooleanSwitch keepTempFiles;
  29.             private static BooleanSwitch pregenEventLog;
  30.             private static TraceSwitch xmlSerialization;
  31.             private static TraceSwitch xslTypeInference;
  32.            
  33.             public static BooleanSwitch XmlSchemaContentModel {
  34.                 get {
  35.                     if (xmlSchemaContentModel == null) {
  36.                         xmlSchemaContentModel = new BooleanSwitch("XmlSchemaContentModel", "Enable tracing for the XmlSchema content model.");
  37.                     }
  38.                     return xmlSchemaContentModel;
  39.                 }
  40.             }
  41.            
  42.             public static TraceSwitch XmlSchema {
  43.                 get {
  44.                     if (xmlSchema == null) {
  45.                         xmlSchema = new TraceSwitch("XmlSchema", "Enable tracing for the XmlSchema class.");
  46.                     }
  47.                     return xmlSchema;
  48.                 }
  49.             }
  50.            
  51.             public static BooleanSwitch KeepTempFiles {
  52.                 get {
  53.                     if (keepTempFiles == null) {
  54.                         keepTempFiles = new BooleanSwitch("XmlSerialization.Compilation", "Keep XmlSerialization generated (temp) files.");
  55.                     }
  56.                     return keepTempFiles;
  57.                 }
  58.             }
  59.            
  60.             public static BooleanSwitch PregenEventLog {
  61.                 get {
  62.                     if (pregenEventLog == null) {
  63.                         pregenEventLog = new BooleanSwitch("XmlSerialization.PregenEventLog", "Log failures while loading pre-generated XmlSerialization assembly.");
  64.                     }
  65.                     return pregenEventLog;
  66.                 }
  67.             }
  68.            
  69.             public static TraceSwitch XmlSerialization {
  70.                 get {
  71.                     if (xmlSerialization == null) {
  72.                         xmlSerialization = new TraceSwitch("XmlSerialization", "Enable tracing for the System.Xml.Serialization component.");
  73.                     }
  74.                     return xmlSerialization;
  75.                 }
  76.             }
  77.            
  78.             public static TraceSwitch XslTypeInference {
  79.                 get {
  80.                     if (xslTypeInference == null) {
  81.                         xslTypeInference = new TraceSwitch("XslTypeInference", "Enable tracing for the XSLT type inference algorithm.");
  82.                     }
  83.                     return xslTypeInference;
  84.                 }
  85.             }
  86.         }
  87.     }
  88. }

Developer Fusion