2 // System.CodeDom.Compiler.CompilerResults.cs
5 // Daniel Stodden (stodden@in.tum.de)
6 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
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:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
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
{
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 ();
48 private Evidence evidence
;
50 private int nativeCompilerReturnValue
= 0;
51 private StringCollection output
= new StringCollection ();
52 private string pathToAssembly
;
53 private TempFileCollection tempFiles
;
58 public CompilerResults (TempFileCollection tempFiles
)
60 this.tempFiles
= tempFiles
;
66 public Assembly CompiledAssembly
{
68 if ((compiledAssembly
== null) && (pathToAssembly
!= null))
69 compiledAssembly
= Assembly
.LoadFrom (pathToAssembly
);
70 return compiledAssembly
;
73 compiledAssembly
= value;
77 public CompilerErrorCollection Errors
{
80 errors
= new CompilerErrorCollection();
86 public Evidence Evidence
{
87 get { return evidence; }
88 [SecurityPermission (SecurityAction
.Demand
, ControlEvidence
= true)]
89 set { evidence = value; }
93 public int NativeCompilerReturnValue
{
95 return nativeCompilerReturnValue
;
98 nativeCompilerReturnValue
= value;
102 public StringCollection Output
{
105 output
= new StringCollection();
113 public string PathToAssembly
{
115 return pathToAssembly
;
118 pathToAssembly
= value;
122 public TempFileCollection TempFiles
{