The Labs \ Source Viewer \ SSCLI \ System.Xml.Xsl \ XsltSettings

  1. //------------------------------------------------------------------------------
  2. // <copyright file="XsltSettings.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. // <spec>http://webdata/xml/specs/XslCompiledTransform.xml</spec>
  15. //------------------------------------------------------------------------------
  16. using System.CodeDom.Compiler;
  17. using System.Reflection;
  18. namespace System.Xml.Xsl
  19. {
  20.    
  21.     public sealed class XsltSettings
  22.     {
  23.         private bool enableDocumentFunction;
  24.         private bool enableScript;
  25.         private bool checkOnly;
  26.         private bool includeDebugInformation;
  27.         private int warningLevel = -1;
  28.         // -1 means not set
  29.         private bool treatWarningsAsErrors;
  30.         private AssemblyName assemblyName;
  31.         private TempFileCollection tempFiles;
  32.        
  33.         public XsltSettings()
  34.         {
  35.         }
  36.        
  37.         public XsltSettings(bool enableDocumentFunction, bool enableScript)
  38.         {
  39.             this.enableDocumentFunction = enableDocumentFunction;
  40.             this.enableScript = enableScript;
  41.         }
  42.        
  43.         public static XsltSettings Default {
  44.             get { return new XsltSettings(false, false); }
  45.         }
  46.        
  47.         public static XsltSettings TrustedXslt {
  48.             get { return new XsltSettings(true, true); }
  49.         }
  50.        
  51.         public bool EnableDocumentFunction {
  52.             get { return enableDocumentFunction; }
  53.             set { enableDocumentFunction = value; }
  54.         }
  55.        
  56.         public bool EnableScript {
  57.             get { return enableScript; }
  58.             set { enableScript = value; }
  59.         }
  60.        
  61.         internal bool CheckOnly {
  62.             get { return checkOnly; }
  63.             set { checkOnly = value; }
  64.         }
  65.        
  66.         internal bool IncludeDebugInformation {
  67.             get { return includeDebugInformation; }
  68.             set { includeDebugInformation = value; }
  69.         }
  70.        
  71.         internal int WarningLevel {
  72.             get { return warningLevel; }
  73.             set { warningLevel = value; }
  74.         }
  75.        
  76.         internal bool TreatWarningsAsErrors {
  77.             get { return treatWarningsAsErrors; }
  78.             set { treatWarningsAsErrors = value; }
  79.         }
  80.        
  81.         internal AssemblyName AssemblyName {
  82.             get { return assemblyName; }
  83.             set { assemblyName = value; }
  84.         }
  85.        
  86.         internal TempFileCollection TempFiles {
  87.             get { return tempFiles; }
  88.             set { tempFiles = value; }
  89.         }
  90.     }
  91. }

Developer Fusion