Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,217 @@
//
// System.CodeDom.Compiler.CodeCompiler.cs
//
// Authors:
// Jackson Harper (Jackson@LatitudeGeo.com)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2002 Jackson Harper, All rights reserved
// (C) 2003 Andreas Nahr
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.IO;
using System.Text;
using System.Reflection;
using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Security.Permissions;
namespace System.CodeDom.Compiler {
public abstract class CodeCompiler : CodeGenerator, ICodeCompiler
{
protected CodeCompiler ()
{
}
protected abstract string CompilerName {
get;
}
protected abstract string FileExtension {
get;
}
protected abstract string CmdArgsFromParameters (CompilerParameters options);
protected virtual CompilerResults FromDom (CompilerParameters options, CodeCompileUnit e)
{
return FromDomBatch (options, new CodeCompileUnit[]{e});
}
protected virtual CompilerResults FromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
{
string[] fileNames = new string[ea.Length];
int i = 0;
if (options == null)
options = new CompilerParameters ();
StringCollection assemblies = options.ReferencedAssemblies;
foreach (CodeCompileUnit e in ea) {
fileNames[i] = Path.ChangeExtension (Path.GetTempFileName(), FileExtension);
FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
StreamWriter s = new StreamWriter (f);
if (e.ReferencedAssemblies != null) {
foreach (string str in e.ReferencedAssemblies) {
if (!assemblies.Contains (str))
assemblies.Add (str);
}
}
((ICodeGenerator)this).GenerateCodeFromCompileUnit (e, s, new CodeGeneratorOptions());
s.Close();
f.Close();
i++;
}
return Compile (options, fileNames, false);
}
protected virtual CompilerResults FromFile (CompilerParameters options, string fileName)
{
return FromFileBatch (options, new string[] {fileName});
}
protected virtual CompilerResults FromFileBatch (CompilerParameters options, string[] fileNames)
{
return Compile (options, fileNames, true);
}
protected virtual CompilerResults FromSource (CompilerParameters options, string source)
{
return FromSourceBatch(options, new string[]{source});
}
protected virtual CompilerResults FromSourceBatch (CompilerParameters options, string[] sources)
{
string[] fileNames = new string[sources.Length];
int i = 0;
foreach (string source in sources) {
fileNames[i] = Path.ChangeExtension (Path.GetTempFileName(), FileExtension);
FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
StreamWriter s = new StreamWriter (f);
s.Write (source);
s.Close ();
f.Close ();
i++;
}
return Compile (options, fileNames, false);
}
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
private CompilerResults Compile (CompilerParameters options, string[] fileNames, bool keepFiles)
{
if (null == options)
throw new ArgumentNullException ("options");
if (null == fileNames)
throw new ArgumentNullException ("fileNames");
options.TempFiles = new TempFileCollection ();
foreach (string file in fileNames) {
options.TempFiles.AddFile (file, keepFiles);
}
options.TempFiles.KeepFiles = keepFiles;
string std_output = String.Empty;
string err_output = String.Empty;
string cmd = String.Concat (CompilerName, " ", CmdArgsFromParameters (options));
CompilerResults results = new CompilerResults (new TempFileCollection ());
results.NativeCompilerReturnValue = Executor.ExecWaitWithCapture (cmd,
options.TempFiles, ref std_output, ref err_output);
string[] compiler_output_lines = std_output.Split (Environment.NewLine.ToCharArray ());
foreach (string error_line in compiler_output_lines)
ProcessCompilerOutputLine (results, error_line);
if (results.Errors.Count == 0)
results.PathToAssembly = options.OutputAssembly;
return results;
}
[MonoTODO]
protected virtual string GetResponseFileCmdArgs (CompilerParameters options, string cmdArgs)
{
// FIXME I'm not sure what this function should do...
throw new NotImplementedException ();
}
CompilerResults ICodeCompiler.CompileAssemblyFromDom (CompilerParameters options, CodeCompileUnit e)
{
return FromDom (options, e);
}
CompilerResults ICodeCompiler.CompileAssemblyFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
{
return FromDomBatch (options, ea);
}
CompilerResults ICodeCompiler.CompileAssemblyFromFile (CompilerParameters options, string fileName)
{
return FromFile (options, fileName);
}
CompilerResults ICodeCompiler.CompileAssemblyFromFileBatch (CompilerParameters options, string[] fileNames)
{
return FromFileBatch (options, fileNames);
}
CompilerResults ICodeCompiler.CompileAssemblyFromSource (CompilerParameters options, string source)
{
return FromSource (options, source);
}
CompilerResults ICodeCompiler.CompileAssemblyFromSourceBatch (CompilerParameters options, string[] sources)
{
return FromSourceBatch (options, sources);
}
protected static string JoinStringArray (string[] sa, string separator)
{
StringBuilder sb = new StringBuilder ();
int length = sa.Length;
if (length > 1) {
for (int i=0; i < length - 1; i++) {
sb.Append ("\"");
sb.Append (sa [i]);
sb.Append ("\"");
sb.Append (separator);
}
}
if (length > 0) {
sb.Append ("\"");
sb.Append (sa [length - 1]);
sb.Append ("\"");
}
return sb.ToString ();
}
protected abstract void ProcessCompilerOutputLine (CompilerResults results, string line);
}
}

View File

@@ -0,0 +1,94 @@
//
// System.Configuration.CodeDomConfigurationHandler
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// Copyright (c) 2005 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
namespace System.CodeDom.Compiler
{
internal sealed class CodeDomConfigurationHandler: ConfigurationSection
{
static ConfigurationPropertyCollection properties;
static ConfigurationProperty compilersProp;
static CompilerCollection default_compilers;
static CodeDomConfigurationHandler ()
{
default_compilers = new CompilerCollection ();
compilersProp = new ConfigurationProperty ("compilers", typeof (CompilerCollection), default_compilers);
properties = new ConfigurationPropertyCollection ();
properties.Add (compilersProp);
}
public CodeDomConfigurationHandler ()
{
}
protected override void InitializeDefault ()
{
compilersProp = new ConfigurationProperty ("compilers", typeof (CompilerCollection), default_compilers);
}
[MonoTODO]
protected override void PostDeserialize ()
{
base.PostDeserialize ();
}
protected override object GetRuntimeObject ()
{
return this;
}
[ConfigurationProperty ("compilers")]
public CompilerCollection Compilers {
get { return (CompilerCollection) base [compilersProp]; }
}
public CompilerInfo[] CompilerInfos {
get {
CompilerCollection cc = (CompilerCollection)base [compilersProp];
if (cc == null)
return null;
return cc.CompilerInfos;
}
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
}
}
#endif

View File

@@ -0,0 +1,314 @@
//
// System.CodeDom.Compiler.CodeDomProvider.cs
//
// Authors:
// Daniel Stodden (stodden@in.tum.de)
// Marek Safar (marek.safar@seznam.cz)
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2002,2003,2004,2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Permissions;
namespace System.CodeDom.Compiler {
[ComVisible (true)]
[ToolboxItem (false)]
public abstract class CodeDomProvider : Component
{
//
// Constructors
//
protected CodeDomProvider()
{
}
//
// Properties
//
public virtual string FileExtension {
get {
return String.Empty;
}
}
public virtual LanguageOptions LanguageOptions {
get {
return LanguageOptions.None;
}
}
//
// Methods
//
[Obsolete ("ICodeCompiler is obsolete")]
public abstract ICodeCompiler CreateCompiler();
[Obsolete ("ICodeGenerator is obsolete")]
public abstract ICodeGenerator CreateGenerator();
public virtual ICodeGenerator CreateGenerator (string fileName)
{
return CreateGenerator();
}
public virtual ICodeGenerator CreateGenerator (TextWriter output)
{
return CreateGenerator();
}
[Obsolete ("ICodeParser is obsolete")]
public virtual ICodeParser CreateParser()
{
return null;
}
public virtual TypeConverter GetConverter (Type type)
{
return TypeDescriptor.GetConverter (type);
}
public virtual CompilerResults CompileAssemblyFromDom (CompilerParameters options, params CodeCompileUnit[] compilationUnits)
{
ICodeCompiler cc = CreateCompiler ();
if (cc == null)
throw GetNotImplemented ();
return cc.CompileAssemblyFromDomBatch (options, compilationUnits);
}
public virtual CompilerResults CompileAssemblyFromFile (CompilerParameters options, params string[] fileNames)
{
ICodeCompiler cc = CreateCompiler ();
if (cc == null)
throw GetNotImplemented ();
return cc.CompileAssemblyFromFileBatch (options, fileNames);
}
public virtual CompilerResults CompileAssemblyFromSource (CompilerParameters options, params string[] sources)
{
ICodeCompiler cc = CreateCompiler ();
if (cc == null)
throw GetNotImplemented ();
return cc.CompileAssemblyFromSourceBatch (options, sources);
}
public virtual string CreateEscapedIdentifier (string value)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
return cg.CreateEscapedIdentifier (value);
}
#if CONFIGURATION_DEP
[ComVisible (false)]
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public static CodeDomProvider CreateProvider (string language)
{
CompilerInfo ci = GetCompilerInfo (language);
return (ci == null) ? null : ci.CreateProvider ();
}
#if NET_4_0
[ComVisible (false)]
public static CodeDomProvider CreateProvider (string language, IDictionary<string, string> providerOptions)
{
CompilerInfo ci = GetCompilerInfo (language);
return ci == null ? null : ci.CreateProvider (providerOptions);
}
#endif
#endif
public virtual string CreateValidIdentifier (string value)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
return cg.CreateValidIdentifier (value);
}
public virtual void GenerateCodeFromCompileUnit (CodeCompileUnit compileUnit,
TextWriter writer, CodeGeneratorOptions options)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
cg.GenerateCodeFromCompileUnit (compileUnit, writer, options);
}
public virtual void GenerateCodeFromExpression (CodeExpression expression, TextWriter writer, CodeGeneratorOptions options)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
cg.GenerateCodeFromExpression (expression, writer, options);
}
public virtual void GenerateCodeFromMember (CodeTypeMember member, TextWriter writer, CodeGeneratorOptions options)
{
// Documented to always throw an exception (if not overriden)
throw GetNotImplemented ();
// Note: the pattern is different from other GenerateCodeFrom* because
// ICodeGenerator doesn't have a GenerateCodeFromMember member
}
public virtual void GenerateCodeFromNamespace (CodeNamespace codeNamespace, TextWriter writer, CodeGeneratorOptions options)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
cg.GenerateCodeFromNamespace (codeNamespace, writer, options);
}
public virtual void GenerateCodeFromStatement (CodeStatement statement, TextWriter writer, CodeGeneratorOptions options)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
cg.GenerateCodeFromStatement (statement, writer, options);
}
public virtual void GenerateCodeFromType (CodeTypeDeclaration codeType, TextWriter writer, CodeGeneratorOptions options)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
cg.GenerateCodeFromType (codeType, writer, options);
}
#if CONFIGURATION_DEP
[ComVisible (false)]
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public static CompilerInfo[] GetAllCompilerInfo ()
{
return (Config == null) ? null : Config.CompilerInfos;
}
[ComVisible (false)]
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public static CompilerInfo GetCompilerInfo (string language)
{
if (language == null)
throw new ArgumentNullException ("language");
if (Config == null)
return null;
CompilerCollection cc = Config.Compilers;
return cc[language];
}
[ComVisible (false)]
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public static string GetLanguageFromExtension (string extension)
{
if (extension == null)
throw new ArgumentNullException ("extension");
if (Config != null)
return Config.Compilers.GetLanguageFromExtension (extension);
return null;
}
#endif
public virtual string GetTypeOutput (CodeTypeReference type)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
return cg.GetTypeOutput (type);
}
#if CONFIGURATION_DEP
[ComVisible (false)]
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public static bool IsDefinedExtension (string extension)
{
if (extension == null)
throw new ArgumentNullException ("extension");
if (Config != null)
return (Config.Compilers.GetCompilerInfoForExtension (extension) != null);
return false;
}
[ComVisible (false)]
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public static bool IsDefinedLanguage (string language)
{
if (language == null)
throw new ArgumentNullException ("language");
if (Config != null)
return (Config.Compilers.GetCompilerInfoForLanguage (language) != null);
return false;
}
#endif
public virtual bool IsValidIdentifier (string value)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
return cg.IsValidIdentifier (value);
}
public virtual CodeCompileUnit Parse (TextReader codeStream)
{
ICodeParser cp = CreateParser ();
if (cp == null)
throw GetNotImplemented ();
return cp.Parse (codeStream);
}
public virtual bool Supports (GeneratorSupport supports)
{
ICodeGenerator cg = CreateGenerator ();
if (cg == null)
throw GetNotImplemented ();
return cg.Supports (supports);
}
#if CONFIGURATION_DEP
static CodeDomConfigurationHandler Config {
get { return ConfigurationManager.GetSection ("system.codedom") as CodeDomConfigurationHandler; }
}
#endif
//
// This is used to prevent confusing Moma about methods not implemented.
//
Exception GetNotImplemented ()
{
return new NotImplementedException ();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,133 @@
//
// System.CodeDom.Compiler CodeGeneratorOptions class
//
// Authors:
// Daniel Stodden (stodden@in.tum.de)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Ximian, Inc.
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using System.Security.Permissions;
namespace System.CodeDom.Compiler {
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public class CodeGeneratorOptions {
private IDictionary properties;
//
// Constructors
//
public CodeGeneratorOptions()
{
properties = new ListDictionary();
}
//
// Properties
//
/// <summary>
/// Whether to insert blank lines between individual members.
/// Default is true.
/// </summary>
public bool BlankLinesBetweenMembers {
get {
object o = properties["BlankLinesBetweenMembers"];
return ((o == null) ? true : (bool) o);
}
set {
properties["BlankLinesBetweenMembers"] = value;
}
}
/// <summary>
/// "Block" puts braces on the same line as the associated statement or declaration.
/// "C" puts braces on the following line.
/// Default is "C"
/// </summary>
public string BracingStyle {
get {
object o = properties["BracingStyle"];
return ((o == null) ? "Block" : (string) o);
}
set {
properties["BracingStyle"] = value;
}
}
/// <summary>
/// Whether to start <code>else</code>,
/// <code>catch</code>, or <code>finally</code>
/// blocks on the same line as the previous block.
/// Default is false.
/// </summary>
public bool ElseOnClosing {
get {
object o = properties["ElseOnClosing"];
return ((o == null) ? false : (bool) o);
}
set {
properties["ElseOnClosing"] = value;
}
}
/// <summary>
/// The string used for individual indentation levels. Default is four spaces.
/// </summary>
public string IndentString {
get {
object o = properties["IndentString"];
return ((o == null) ? " " : (string) o);
}
set {
properties["IndentString"] = value;
}
}
public Object this[string index] {
get {
return properties[index];
}
set {
properties[index] = value;
}
}
[ComVisible (false)]
public bool VerbatimOrder {
get {
object o = properties["VerbatimOrder"];
return ((o == null) ? false : (bool) o);
}
set {
properties["VerbatimOrder"] = value;
}
}
}
}

View File

@@ -0,0 +1,45 @@
//
// System.CodeDom.Compiler.CodeParser.cs
//
// Author:
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Andreas Nahr
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.IO;
namespace System.CodeDom.Compiler
{
public abstract class CodeParser : ICodeParser
{
protected CodeParser ()
{
}
public abstract CodeCompileUnit Parse (TextReader codeStream);
}
}

View File

@@ -0,0 +1,134 @@
//
// System.Web.Configuration.CompilerCollection
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
// (C) 2005 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using TypeDescriptor = PrebuiltSystem.System.ComponentModel.TypeDescriptor;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
namespace System.CodeDom.Compiler
{
internal sealed class Compiler : ConfigurationElement
{
static ConfigurationProperty compilerOptionsProp;
static ConfigurationProperty extensionProp;
static ConfigurationProperty languageProp;
static ConfigurationProperty typeProp;
static ConfigurationProperty warningLevelProp;
static ConfigurationProperty providerOptionsProp;
static ConfigurationPropertyCollection properties;
static Compiler ()
{
compilerOptionsProp = new ConfigurationProperty("compilerOptions", typeof (string), "");
extensionProp = new ConfigurationProperty("extension", typeof (string), "");
languageProp = new ConfigurationProperty("language", typeof (string), "", ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
typeProp = new ConfigurationProperty("type", typeof (string), "", ConfigurationPropertyOptions.IsRequired);
warningLevelProp = new ConfigurationProperty("warningLevel", typeof (int), 0,
TypeDescriptor.GetConverter (typeof (int)),
new IntegerValidator (0, 4),
ConfigurationPropertyOptions.None);
providerOptionsProp = new ConfigurationProperty ("", typeof (CompilerProviderOptionsCollection), null, null, null,
ConfigurationPropertyOptions.IsDefaultCollection);
properties = new ConfigurationPropertyCollection ();
properties.Add (compilerOptionsProp);
properties.Add (extensionProp);
properties.Add (languageProp);
properties.Add (typeProp);
properties.Add (warningLevelProp);
properties.Add (providerOptionsProp);
}
internal Compiler ()
{
}
public Compiler (string compilerOptions, string extension, string language, string type, int warningLevel)
{
this.CompilerOptions = compilerOptions;
this.Extension = extension;
this.Language = language;
this.Type = type;
this.WarningLevel = warningLevel;
}
[ConfigurationProperty ("compilerOptions", DefaultValue = "")]
public string CompilerOptions {
get { return (string) base[compilerOptionsProp]; }
internal set { base[compilerOptionsProp] = value; }
}
[ConfigurationProperty ("extension", DefaultValue = "")]
public string Extension {
get { return (string) base[extensionProp]; }
internal set { base[extensionProp] = value; }
}
[ConfigurationProperty ("language", DefaultValue = "", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
public string Language {
get { return (string) base[languageProp]; }
internal set { base[languageProp] = value; }
}
[ConfigurationProperty ("type", DefaultValue = "", Options = ConfigurationPropertyOptions.IsRequired)]
public string Type {
get { return (string) base[typeProp]; }
internal set { base[typeProp] = value; }
}
[IntegerValidator (MinValue = 0, MaxValue = 4)]
[ConfigurationProperty ("warningLevel", DefaultValue = "0")]
public int WarningLevel {
get { return (int) base[warningLevelProp]; }
internal set { base[warningLevelProp] = value; }
}
[ConfigurationProperty ("", Options = ConfigurationPropertyOptions.IsDefaultCollection)]
public CompilerProviderOptionsCollection ProviderOptions {
get { return (CompilerProviderOptionsCollection) base [providerOptionsProp]; }
internal set { base [providerOptionsProp] = value; }
}
public Dictionary <string, string> ProviderOptionsDictionary {
get { return ProviderOptions.ProviderOptions; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
}
}
#endif

View File

@@ -0,0 +1,242 @@
//
// System.Web.Configuration.CompilerCollection
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
// (C) 2005 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System;
using System.Collections.Generic;
using System.Configuration;
namespace System.CodeDom.Compiler
{
[ConfigurationCollection (typeof (Compiler), AddItemName = "compiler", CollectionType = ConfigurationElementCollectionType.BasicMap)]
internal sealed class CompilerCollection : ConfigurationElementCollection
{
#if NET_4_0
static readonly string defaultCompilerVersion = "3.5";
#else
static readonly string defaultCompilerVersion = "2.0";
#endif
static ConfigurationPropertyCollection properties;
static List <CompilerInfo> compiler_infos;
static Dictionary <string, CompilerInfo> compiler_languages;
static Dictionary <string, CompilerInfo> compiler_extensions;
static CompilerCollection ()
{
properties = new ConfigurationPropertyCollection ();
compiler_infos = new List <CompilerInfo> ();
compiler_languages = new Dictionary <string, CompilerInfo> (16, StringComparer.OrdinalIgnoreCase);
compiler_extensions = new Dictionary <string, CompilerInfo> (6, StringComparer.OrdinalIgnoreCase);
CompilerInfo compiler = new CompilerInfo ();
compiler.Languages = "c#;cs;csharp";
compiler.Extensions = ".cs";
compiler.TypeName = "Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
compiler.ProviderOptions = new Dictionary <string, string> (1);
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
AddCompilerInfo (compiler);
compiler = new CompilerInfo ();
compiler.Languages = "vb;vbs;visualbasic;vbscript";
compiler.Extensions = ".vb";
compiler.TypeName = "Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
compiler.ProviderOptions = new Dictionary <string, string> (1);
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
AddCompilerInfo (compiler);
compiler = new CompilerInfo ();
compiler.Languages = "js;jscript;javascript";
compiler.Extensions = ".js";
compiler.TypeName = "Microsoft.JScript.JScriptCodeProvider, Microsoft.JScript, Version=8.0.1100.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
compiler.ProviderOptions = new Dictionary <string, string> (1);
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
AddCompilerInfo (compiler);
compiler = new CompilerInfo ();
compiler.Languages = "vj#;vjs;vjsharp";
compiler.Extensions = ".jsl;.java";
compiler.TypeName = "Microsoft.VJSharp.VJSharpCodeProvider, VJSharpCodeProvider, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
compiler.ProviderOptions = new Dictionary <string, string> (1);
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
AddCompilerInfo (compiler);
compiler = new CompilerInfo ();
compiler.Languages = "c++;mc;cpp";
compiler.Extensions = ".h";
compiler.TypeName = "Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
compiler.ProviderOptions = new Dictionary <string, string> (1);
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
AddCompilerInfo (compiler);
}
public CompilerCollection ()
{
}
static void AddCompilerInfo (CompilerInfo ci)
{
ci.Init ();
compiler_infos.Add (ci);
string[] languages = ci.GetLanguages ();
if (languages != null)
foreach (string language in languages)
compiler_languages [language] = ci;
string[] extensions = ci.GetExtensions ();
if (extensions != null)
foreach (string extension in extensions)
compiler_extensions [extension] = ci;
}
static void AddCompilerInfo (Compiler compiler)
{
CompilerInfo ci = new CompilerInfo ();
ci.Languages = compiler.Language;
ci.Extensions = compiler.Extension;
ci.TypeName = compiler.Type;
ci.ProviderOptions = compiler.ProviderOptionsDictionary;
ci.CompilerOptions = compiler.CompilerOptions;
ci.WarningLevel = compiler.WarningLevel;
AddCompilerInfo (ci);
}
protected override void BaseAdd (ConfigurationElement element)
{
Compiler compiler = element as Compiler;
if (compiler != null)
AddCompilerInfo (compiler);
base.BaseAdd (element);
}
protected override bool ThrowOnDuplicate {
get { return false; }
}
protected override ConfigurationElement CreateNewElement ()
{
return new Compiler ();
}
public CompilerInfo GetCompilerInfoForLanguage (string language)
{
if (compiler_languages.Count == 0)
return null;
CompilerInfo ci;
if (compiler_languages.TryGetValue (language, out ci))
return ci;
return null;
}
public CompilerInfo GetCompilerInfoForExtension (string extension)
{
if (compiler_extensions.Count == 0)
return null;
CompilerInfo ci;
if (compiler_extensions.TryGetValue (extension, out ci))
return ci;
return null;
}
public string GetLanguageFromExtension (string extension)
{
CompilerInfo ci = GetCompilerInfoForExtension (extension);
if (ci == null)
return null;
string[] languages = ci.GetLanguages ();
if (languages != null && languages.Length > 0)
return languages [0];
return null;
}
public Compiler Get (int index)
{
return (Compiler) BaseGet (index);
}
public Compiler Get (string language)
{
return (Compiler) BaseGet (language);
}
protected override object GetElementKey (ConfigurationElement element)
{
return ((Compiler)element).Language;
}
public string GetKey (int index)
{
return (string)BaseGetKey (index);
}
public string[ ] AllKeys {
get {
string[] keys = new string[compiler_infos.Count];
for (int i = 0; i < Count; i++)
keys[i] = compiler_infos[i].Languages;
return keys;
}
}
public override ConfigurationElementCollectionType CollectionType {
get { return ConfigurationElementCollectionType.BasicMap; }
}
protected override string ElementName {
get { return "compiler"; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
public Compiler this[int index] {
get { return (Compiler) BaseGet (index); }
}
public new CompilerInfo this[string language] {
get {
return GetCompilerInfoForLanguage (language);
}
}
public CompilerInfo[] CompilerInfos {
get {
return compiler_infos.ToArray ();
}
}
}
}
#endif

View File

@@ -0,0 +1,102 @@
//
// System.CodeDom.Compiler.CompilerError
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Security.Permissions;
namespace System.CodeDom.Compiler {
[Serializable]
public class CompilerError {
string fileName;
int line;
int column;
string errorNumber;
string errorText;
bool isWarning = false;
public CompilerError () :
this (String.Empty, 0, 0, String.Empty, String.Empty)
{
}
public CompilerError (string fileName, int line, int column, string errorNumber, string errorText)
{
this.fileName = fileName;
this.line = line;
this.column = column;
this.errorNumber = errorNumber;
this.errorText = errorText;
}
public override string ToString ()
{
string type = isWarning ? "warning" : "error";
return String.Format (System.Globalization.CultureInfo.InvariantCulture,
"{0}({1},{2}) : {3} {4}: {5}", fileName, line, column, type,
errorNumber, errorText);
}
public int Line
{
get { return line; }
set { line = value; }
}
public int Column
{
get { return column; }
set { column = value; }
}
public string ErrorNumber
{
get { return errorNumber; }
set { errorNumber = value; }
}
public string ErrorText
{
get { return errorText; }
set { errorText = value; }
}
public bool IsWarning
{
get { return isWarning; }
set { isWarning = value; }
}
public string FileName
{
get { return fileName; }
set { fileName = value; }
}
}
}

View File

@@ -0,0 +1,118 @@
//
// System.CodeDom.Compiler.CompilerErrorCollection.cs
//
// Authors:
// Daniel Stodden (stodden@in.tum.de)
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2002 Ximian, Inc. (http://www.ximian.com)
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Security.Permissions;
namespace System.CodeDom.Compiler {
[Serializable]
#if ONLY_1_1
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
#endif
public class CompilerErrorCollection : CollectionBase
{
public CompilerErrorCollection ()
{
}
public CompilerErrorCollection (CompilerErrorCollection value)
{
InnerList.AddRange(value.InnerList);
}
public CompilerErrorCollection (CompilerError[] value)
{
InnerList.AddRange(value);
}
public int Add (CompilerError value)
{
return InnerList.Add(value);
}
public void AddRange (CompilerError[] value)
{
InnerList.AddRange(value);
}
public void AddRange (CompilerErrorCollection value)
{
InnerList.AddRange(value.InnerList);
}
public bool Contains (CompilerError value)
{
return InnerList.Contains(value);
}
public void CopyTo (CompilerError[] array, int index)
{
InnerList.CopyTo(array,index);
}
public int IndexOf (CompilerError value)
{
return InnerList.IndexOf(value);
}
public void Insert (int index, CompilerError value)
{
InnerList.Insert(index,value);
}
public void Remove (CompilerError value)
{
InnerList.Remove(value);
}
public CompilerError this [int index] {
get { return (CompilerError) InnerList[index]; }
set { InnerList[index]=value; }
}
public bool HasErrors {
get {
foreach (CompilerError error in InnerList)
if (!error.IsWarning) return true;
return false;
}
}
public bool HasWarnings {
get {
foreach (CompilerError error in InnerList)
if (error.IsWarning) return true;
return false;
}
}
}
}

View File

@@ -0,0 +1,146 @@
//
// System.CodeDom.Compiler CompilerInfo class
//
// Author:
// Marek Safar (marek.safar@seznam.cz)
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// Copyright (c) 2004,2005 Novell, Inc. (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Configuration;
using System.Collections.Generic;
using System.Reflection;
using System.Security.Permissions;
namespace System.CodeDom.Compiler {
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public sealed class CompilerInfo
{
internal string Languages;
internal string Extensions;
internal string TypeName;
internal int WarningLevel;
internal string CompilerOptions;
internal Dictionary <string, string> ProviderOptions;
bool inited;
Type type;
internal CompilerInfo ()
{
}
internal void Init ()
{
if (inited)
return;
inited = true;
type = Type.GetType (TypeName);
if (type == null)
return;
if (!typeof (CodeDomProvider).IsAssignableFrom (type))
type = null;
}
public Type CodeDomProviderType {
get {
if (type == null) {
type = Type.GetType (TypeName, false);
#if CONFIGURATION_DEP
if (type == null)
throw new ConfigurationErrorsException ("Unable to locate compiler type '" + TypeName + "'");
#endif
}
return type;
}
}
public bool IsCodeDomProviderTypeValid {
get { return type != null; }
}
public CompilerParameters CreateDefaultCompilerParameters ()
{
CompilerParameters cparams = new CompilerParameters ();
if (CompilerOptions == null)
cparams.CompilerOptions = String.Empty;
else
cparams.CompilerOptions = CompilerOptions;
cparams.WarningLevel = WarningLevel;
return cparams;
}
public CodeDomProvider CreateProvider ()
{
return CreateProvider (ProviderOptions);
}
#if NET_4_0
public
#endif
CodeDomProvider CreateProvider (IDictionary<string, string> providerOptions)
{
Type providerType = CodeDomProviderType;
if (providerOptions != null && providerOptions.Count > 0) {
ConstructorInfo ctor = providerType.GetConstructor (new [] { typeof (IDictionary <string, string>) });
if (ctor != null)
return (CodeDomProvider) ctor.Invoke (new object[] { providerOptions });
}
return (CodeDomProvider) Activator.CreateInstance (providerType);
}
public override bool Equals (object o)
{
if (!(o is CompilerInfo))
return false;
CompilerInfo c = (CompilerInfo) o;
return c.TypeName == TypeName;
}
public override int GetHashCode ()
{
return TypeName.GetHashCode ();
}
public string [] GetExtensions ()
{
return Extensions.Split (';');
}
public string [] GetLanguages ()
{
return Languages.Split (';');
}
}
}

View File

@@ -0,0 +1,226 @@
//
// System.CodeDom.Compiler.CompilerParameters.cs
//
// Authors:
// Daniel Stodden (stodden@in.tum.de)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2002 Ximian, Inc.
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Security.Policy;
namespace System.CodeDom.Compiler {
[Serializable]
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class CompilerParameters {
private string compilerOptions;
private Evidence evidence;
private bool generateExecutable = false;
private bool generateInMemory = false;
private bool includeDebugInformation = false;
private string mainClass;
private string outputAssembly;
private StringCollection referencedAssemblies;
private TempFileCollection tempFiles;
private bool treatWarningsAsErrors = false;
private IntPtr userToken = IntPtr.Zero;
private int warningLevel = -1;
private string win32Resource;
private StringCollection embedded_resources;
private StringCollection linked_resources;
//
// Constructors
//
public CompilerParameters()
{
}
public CompilerParameters (string[] assemblyNames)
{
referencedAssemblies = new StringCollection();
referencedAssemblies.AddRange (assemblyNames);
}
public CompilerParameters (string[] assemblyNames, string output)
{
referencedAssemblies = new StringCollection();
referencedAssemblies.AddRange (assemblyNames);
outputAssembly = output;
}
public CompilerParameters (string[] assemblyNames, string output, bool includeDebugInfo)
{
referencedAssemblies = new StringCollection();
referencedAssemblies.AddRange (assemblyNames);
outputAssembly = output;
includeDebugInformation = includeDebugInfo;
}
//
// Properties
//
public string CompilerOptions {
get {
return compilerOptions;
}
set {
compilerOptions = value;
}
}
#if NET_4_0
[Obsolete]
#endif
public Evidence Evidence {
get { return evidence; }
[SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
set { evidence = value; }
}
public bool GenerateExecutable {
get {
return generateExecutable;
}
set {
generateExecutable = value;
}
}
public bool GenerateInMemory {
get {
return generateInMemory;
}
set {
generateInMemory = value;
}
}
public bool IncludeDebugInformation {
get {
return includeDebugInformation;
}
set {
includeDebugInformation = value;
}
}
public string MainClass {
get {
return mainClass;
}
set {
mainClass = value;
}
}
public string OutputAssembly {
get {
return outputAssembly;
}
set {
outputAssembly = value;
}
}
public StringCollection ReferencedAssemblies {
get {
if (referencedAssemblies == null)
referencedAssemblies = new StringCollection ();
return referencedAssemblies;
}
}
public TempFileCollection TempFiles {
get {
if (tempFiles == null)
tempFiles = new TempFileCollection ();
return tempFiles;
}
set {
tempFiles = value;
}
}
public bool TreatWarningsAsErrors {
get {
return treatWarningsAsErrors;
}
set {
treatWarningsAsErrors = value;
}
}
public IntPtr UserToken {
get {
return userToken;
}
set {
userToken = value;
}
}
public int WarningLevel {
get {
return warningLevel;
}
set {
warningLevel = value;
}
}
public string Win32Resource {
get {
return win32Resource;
}
set {
win32Resource = value;
}
}
[ComVisible (false)]
public StringCollection EmbeddedResources {
get {
if (embedded_resources == null)
embedded_resources = new StringCollection ();
return embedded_resources;
}
}
[ComVisible (false)]
public StringCollection LinkedResources {
get {
if (linked_resources == null)
linked_resources = new StringCollection ();
return linked_resources;
}
}
}
}

View File

@@ -0,0 +1,71 @@
// System.Web.Configuration.CompilerProviderOptionsCollection.cs
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2007 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System;
using System.Configuration;
namespace System.CodeDom.Compiler
{
internal sealed class CompilerProviderOption : ConfigurationElement
{
static ConfigurationProperty nameProp;
static ConfigurationProperty valueProp;
static ConfigurationPropertyCollection properties;
static CompilerProviderOption ()
{
nameProp = new ConfigurationProperty ("name", typeof (string), "",
ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
valueProp = new ConfigurationProperty ("value", typeof (string), "",
ConfigurationPropertyOptions.IsRequired);
properties = new ConfigurationPropertyCollection ();
properties.Add (nameProp);
properties.Add (valueProp);
}
[ConfigurationProperty ("name", DefaultValue = "", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
public string Name {
get { return (string) base [nameProp]; }
set { base [nameProp] = value; }
}
[ConfigurationProperty ("value", DefaultValue = "", Options = ConfigurationPropertyOptions.IsRequired)]
public string Value {
get { return (string) base [valueProp]; }
set { base [valueProp] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
}
}
#endif

View File

@@ -0,0 +1,131 @@
//
// System.Web.Configuration.CompilerProviderOptionsCollection.cs
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2007 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP
using System;
using System.Configuration;
using System.Collections.Generic;
namespace System.CodeDom.Compiler
{
[ConfigurationCollection (typeof (CompilerProviderOption), CollectionType = ConfigurationElementCollectionType.BasicMap, AddItemName = "providerOption")]
internal sealed class CompilerProviderOptionsCollection : ConfigurationElementCollection
{
static ConfigurationPropertyCollection properties;
static CompilerProviderOptionsCollection ()
{
properties = new ConfigurationPropertyCollection ();
}
public CompilerProviderOptionsCollection ()
{
}
protected override ConfigurationElement CreateNewElement ()
{
return new CompilerProviderOption ();
}
public CompilerProviderOption Get (int index)
{
return (CompilerProviderOption) BaseGet (index);
}
public CompilerProviderOption Get (string name)
{
return (CompilerProviderOption) BaseGet (name);
}
protected override object GetElementKey (ConfigurationElement element)
{
return ((CompilerProviderOption) element).Name;
}
public string GetKey (int index)
{
return (string) BaseGetKey (index);
}
public string[] AllKeys {
get {
int count = Count;
string[] keys = new string [count];
for (int i = 0; i < count; i++)
keys [i] = this [i].Name;
return keys;
}
}
protected override string ElementName {
get { return "providerOption"; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
public Dictionary <string, string> ProviderOptions {
get {
int count = Count;
if (count == 0)
return null;
Dictionary <string, string> ret = new Dictionary <string, string> (count);
CompilerProviderOption opt;
for (int i = 0; i < count; i++) {
opt = this [i];
ret.Add (opt.Name, opt.Value);
}
return ret;
}
}
public CompilerProviderOption this [int index] {
get { return (CompilerProviderOption) BaseGet (index); }
}
public new CompilerProviderOption this [string name] {
get {
foreach (CompilerProviderOption c in this) {
if (c.Name == name)
return c;
}
return null;
}
}
}
}
#endif

View File

@@ -0,0 +1,128 @@
//
// System.CodeDom.Compiler.CompilerResults.cs
//
// Authors:
// Daniel Stodden (stodden@in.tum.de)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2002 Ximian, Inc.
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections.Specialized;
using System.Reflection;
using System.Security.Permissions;
using System.Security.Policy;
namespace System.CodeDom.Compiler {
[Serializable]
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class CompilerResults {
private Assembly compiledAssembly;
private CompilerErrorCollection errors = new CompilerErrorCollection ();
private Evidence evidence;
private int nativeCompilerReturnValue = 0;
private StringCollection output = new StringCollection ();
private string pathToAssembly;
private TempFileCollection tempFiles;
//
// Constructors
//
public CompilerResults (TempFileCollection tempFiles)
{
this.tempFiles = tempFiles;
}
//
// Properties
//
public Assembly CompiledAssembly {
get {
if ((compiledAssembly == null) && (pathToAssembly != null))
compiledAssembly = Assembly.LoadFrom (pathToAssembly);
return compiledAssembly;
}
set {
compiledAssembly = value;
}
}
public CompilerErrorCollection Errors {
get {
if (errors == null)
errors = new CompilerErrorCollection();
return errors;
}
}
#if NET_4_0
[Obsolete]
#endif
public Evidence Evidence {
get { return evidence; }
[SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
set { evidence = value; }
}
public int NativeCompilerReturnValue {
get {
return nativeCompilerReturnValue;
}
set {
nativeCompilerReturnValue = value;
}
}
public StringCollection Output {
get {
if (output == null)
output = new StringCollection();
return output;
}
internal set {
output = value;
}
}
public string PathToAssembly {
get {
return pathToAssembly;
}
set {
pathToAssembly = value;
}
}
public TempFileCollection TempFiles {
get {
return tempFiles;
}
set {
tempFiles = value;
}
}
}
}

View File

@@ -0,0 +1,147 @@
//
// System.CodeDom.Compiler.Executor.cs
//
// Authors:
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Andreas Nahr
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Security.Principal;
using System.Threading;
namespace System.CodeDom.Compiler {
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public static class Executor {
class ProcessResultReader
{
StreamReader reader;
string file;
public ProcessResultReader (StreamReader reader, string file)
{
this.reader = reader;
this.file = file;
}
public void Read ()
{
StreamWriter sw = new StreamWriter (file);
try
{
string line;
while ((line = reader.ReadLine()) != null)
sw.WriteLine (line);
}
finally
{
sw.Close ();
}
}
}
public static void ExecWait (string cmd, TempFileCollection tempFiles)
{
string outputName = null;
string errorName = null;
ExecWaitWithCapture (cmd, Environment.CurrentDirectory, tempFiles, ref outputName, ref errorName);
}
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
[SecurityPermission (SecurityAction.Assert, ControlPrincipal = true)] // UnmanagedCode "covers" more than ControlPrincipal
public static Int32 ExecWaitWithCapture (IntPtr userToken, string cmd, string currentDir, TempFileCollection tempFiles, ref string outputName, ref string errorName)
{
// WindowsImpersonationContext implements IDisposable only in 2.0
using (WindowsImpersonationContext context = WindowsIdentity.Impersonate (userToken)) {
return InternalExecWaitWithCapture (cmd, currentDir, tempFiles, ref outputName, ref errorName);
}
}
public static Int32 ExecWaitWithCapture (IntPtr userToken, string cmd, TempFileCollection tempFiles, ref string outputName, ref string errorName)
{
return ExecWaitWithCapture (userToken, cmd, Environment.CurrentDirectory, tempFiles, ref outputName, ref errorName);
}
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public static Int32 ExecWaitWithCapture (string cmd, string currentDir, TempFileCollection tempFiles, ref string outputName, ref string errorName )
{
return InternalExecWaitWithCapture (cmd, currentDir, tempFiles, ref outputName, ref errorName);
}
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public static Int32 ExecWaitWithCapture (string cmd, TempFileCollection tempFiles, ref string outputName, ref string errorName)
{
return InternalExecWaitWithCapture (cmd, Environment.CurrentDirectory, tempFiles, ref outputName, ref errorName);
}
private static int InternalExecWaitWithCapture (string cmd, string currentDir, TempFileCollection tempFiles, ref string outputName, ref string errorName)
{
if ((cmd == null) || (cmd.Length == 0))
throw new ExternalException (Locale.GetText ("No command provided for execution."));
if (outputName == null)
outputName = tempFiles.AddExtension ("out");
if (errorName == null)
errorName = tempFiles.AddExtension ("err");
int exit_code = -1;
Process proc = new Process ();
proc.StartInfo.FileName = cmd;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.WorkingDirectory = currentDir;
try {
proc.Start();
ProcessResultReader outReader = new ProcessResultReader (proc.StandardOutput, outputName);
ProcessResultReader errReader = new ProcessResultReader (proc.StandardError, errorName);
Thread t = new Thread (new ThreadStart (errReader.Read));
t.Start ();
outReader.Read ();
t.Join ();
proc.WaitForExit();
}
finally {
exit_code = proc.ExitCode;
// the handle is cleared in Close (so no ExitCode)
proc.Close ();
}
return exit_code;
}
}
}

View File

@@ -0,0 +1,53 @@
//
// System.CodeDom.Compiler.GeneratedCodeAttribute class
//
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.CodeDom.Compiler {
[AttributeUsage (AttributeTargets.All, Inherited = false, AllowMultiple = false)]
public sealed class GeneratedCodeAttribute : Attribute {
private string tool;
private string version;
public GeneratedCodeAttribute (string tool, string version)
{
this.tool = tool;
this.version = version;
}
public string Tool {
get { return tool; }
}
public string Version {
get { return version; }
}
}
}

View File

@@ -0,0 +1,65 @@
//
// System.CodeDom.Compiler GeneratorSupport Class implementation
//
// Author:
// Daniel Stodden (stodden@in.tum.de)
// Marek Safar (marek.safar@seznam.cz)
//
// (C) 2002 Ximian, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.CodeDom.Compiler
{
[Flags]
[Serializable]
public enum GeneratorSupport {
ArraysOfArrays = 1,
EntryPointMethod = 1 << 1,
GotoStatements = 1 << 2,
MultidimensionalArrays = 1 << 3,
StaticConstructors = 1 << 4,
TryCatchStatements = 1 << 5,
ReturnTypeAttributes = 1 << 6,
DeclareValueTypes = 1 << 7,
DeclareEnums = 1 << 8,
DeclareDelegates = 1 << 9,
DeclareInterfaces = 1 << 10,
DeclareEvents = 1 << 11,
AssemblyAttributes = 1 << 12,
ParameterAttributes = 1 << 13,
ReferenceParameters = 1 << 14,
ChainedConstructorArguments = 1 << 15,
NestedTypes = 1 << 16,
MultipleInterfaceMembers = 1 << 17,
PublicStaticMembers = 1 << 18,
ComplexExpressions = 1 << 19,
Win32Resources = 1 << 20,
Resources = 1 << 21,
PartialTypes = 1 << 22,
GenericTypeReference = 1 << 23,
GenericTypeDeclaration = 1 << 24,
DeclareIndexerProperties = 1 << 25,
}
}

View File

@@ -0,0 +1,53 @@
//
// System.CodeDom.Compiler ICodeCompiler Interface
//
// Author:
// Daniel Stodden (stodden@in.tum.de)
//
// (C) 2002 Ximian, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.CodeDom.Compiler
{
public interface ICodeCompiler
{
CompilerResults CompileAssemblyFromDom( CompilerParameters options,
CodeCompileUnit compilationUnit );
CompilerResults CompileAssemblyFromDomBatch( CompilerParameters options,
CodeCompileUnit[] batch );
CompilerResults CompileAssemblyFromFile( CompilerParameters options,
string fileName );
CompilerResults CompileAssemblyFromFileBatch( CompilerParameters options,
string[] batch );
CompilerResults CompileAssemblyFromSource( CompilerParameters options,
string source );
CompilerResults CompileAssemblyFromSourceBatch( CompilerParameters options,
string[] batch );
}
}

Some files were not shown because too many files have changed in this diff Show More