2010-04-06 Jb Evain <jbevain@novell.com>
[mcs.git] / class / System / System.CodeDom.Compiler / CompilerResults.cs
blobcc5df7b31c3f283b8a8eca0666b0d19e592217b5
1 //
2 // System.CodeDom.Compiler.CompilerResults.cs
3 //
4 // Authors:
5 // Daniel Stodden (stodden@in.tum.de)
6 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
7 //
8 // (C) 2002 Ximian, Inc.
9 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 //
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections.Specialized;
32 using System.Reflection;
33 using System.Security.Permissions;
34 using System.Security.Policy;
36 namespace System.CodeDom.Compiler {
38 #if NET_2_0
39 [Serializable]
40 #endif
41 [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
42 [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
43 public class CompilerResults {
45 private Assembly compiledAssembly;
46 private CompilerErrorCollection errors = new CompilerErrorCollection ();
47 #if NET_1_1
48 private Evidence evidence;
49 #endif
50 private int nativeCompilerReturnValue = 0;
51 private StringCollection output = new StringCollection ();
52 private string pathToAssembly;
53 private TempFileCollection tempFiles;
56 // Constructors
58 public CompilerResults (TempFileCollection tempFiles)
60 this.tempFiles = tempFiles;
64 // Properties
66 public Assembly CompiledAssembly {
67 get {
68 if ((compiledAssembly == null) && (pathToAssembly != null))
69 compiledAssembly = Assembly.LoadFrom (pathToAssembly);
70 return compiledAssembly;
72 set {
73 compiledAssembly = value;
77 public CompilerErrorCollection Errors {
78 get {
79 if (errors == null)
80 errors = new CompilerErrorCollection();
81 return errors;
85 #if NET_1_1
86 public Evidence Evidence {
87 get { return evidence; }
88 [SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
89 set { evidence = value; }
91 #endif
93 public int NativeCompilerReturnValue {
94 get {
95 return nativeCompilerReturnValue;
97 set {
98 nativeCompilerReturnValue = value;
102 public StringCollection Output {
103 get {
104 if (output == null)
105 output = new StringCollection();
106 return output;
108 internal set {
109 output = value;
113 public string PathToAssembly {
114 get {
115 return pathToAssembly;
117 set {
118 pathToAssembly = value;
122 public TempFileCollection TempFiles {
123 get {
124 return tempFiles;
126 set {
127 tempFiles = value;