66using System . Threading ;
77
88namespace Microsoft . CodeDom . Providers . DotNetCompilerPlatform {
9+
10+ /// <summary>
11+ /// A set of options for the C# and VB CodeProviders.
12+ /// </summary>
913 public sealed class ProviderOptions : IProviderOptions {
1014
1115 private IDictionary < string , string > _allOptions ;
1216
17+ /// <summary>
18+ /// Create a default set of options for the C# and VB CodeProviders.
19+ /// </summary>
1320 public ProviderOptions ( )
1421 {
1522 this . CompilerFullPath = null ;
@@ -31,7 +38,10 @@ public ProviderOptions()
3138 this . UseAspNetSettings = false ;
3239 }
3340
34- public ProviderOptions ( IProviderOptions opts ) : this ( )
41+ /// <summary>
42+ /// Create a set of options for the C# or VB CodeProviders using the specified inputs.
43+ /// </summary>
44+ public ProviderOptions ( IProviderOptions opts )
3545 {
3646 this . CompilerFullPath = opts . CompilerFullPath ;
3747 this . CompilerServerTimeToLive = opts . CompilerServerTimeToLive ;
@@ -41,29 +51,54 @@ public ProviderOptions(IProviderOptions opts) : this()
4151 this . AllOptions = opts . AllOptions ;
4252 }
4353
44- internal ProviderOptions ( ICompilerSettings settings ) : this ( )
54+ /// <summary>
55+ /// Create a set of options for the C# or VB CodeProviders using some specified inputs.
56+ /// </summary>
57+ public ProviderOptions ( string compilerFullPath , int compilerServerTimeToLive ) : this ( )
4558 {
46- this . CompilerFullPath = settings . CompilerFullPath ;
47- this . CompilerServerTimeToLive = settings . CompilerServerTimeToLive ;
59+ this . CompilerFullPath = compilerFullPath ;
60+ this . CompilerServerTimeToLive = compilerServerTimeToLive ;
4861 }
4962
63+ #pragma warning disable CS0618
64+ internal ProviderOptions ( ICompilerSettings settings ) : this ( settings . CompilerFullPath , settings . CompilerServerTimeToLive ) { }
65+ #pragma warning restore CS0618
66+
67+ /// <summary>
68+ /// The full path to csc.exe or vbc.exe
69+ /// </summary>
5070 public string CompilerFullPath { get ; internal set ; }
5171
72+ /// <summary>
73+ /// TTL in seconds
74+ /// </summary>
5275 public int CompilerServerTimeToLive { get ; internal set ; }
5376
54- // smolloy todo debug degub - we don't use this. It is used by the framework. Do we care to call it out like this?
77+ /// <summary>
78+ /// Used by in-box framework code providers to determine which compat version of the compiler to use.
79+ /// </summary>
5580 public string CompilerVersion { get ; internal set ; }
5681
82+ // smolloy todo debug degub - Does it really override everything? Is that the right thing to do?
83+ /// <summary>
84+ /// Treat all warnings as errors. Will override defaults and command-line options given for a compiler.
85+ /// </summary>
5786 public bool WarnAsError { get ; internal set ; }
5887
88+ /// <summary>
89+ /// Use the set of compiler options that was traditionally added programatically for ASP.Net.
90+ /// </summary>
5991 public bool UseAspNetSettings { get ; internal set ; }
6092
93+ /// <summary>
94+ /// A collection of all <providerOptions> specified in config for the given CodeDomProvider.
95+ /// </summary>
6196 public IDictionary < string , string > AllOptions {
6297 get {
6398 return _allOptions ;
6499 }
65100 internal set {
66- _allOptions = new ReadOnlyDictionary < string , string > ( value ) ;
101+ _allOptions = ( value != null ) ? new ReadOnlyDictionary < string , string > ( value ) : null ;
67102 }
68103 }
69104 }
0 commit comments