Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / CodeDOM / Compiler / CompilerResults.cs / 1305376 / CompilerResults.cs
//------------------------------------------------------------------------------
//
//
// [....]
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.CodeDom.Compiler {
using System;
using System.CodeDom;
using System.Reflection;
using System.Collections;
using System.Collections.Specialized;
using System.Security;
using System.Security.Permissions;
using System.Security.Policy;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Versioning;
using System.IO;
///
///
/// Represents the results
/// of compilation from the compiler.
///
///
[Serializable()]
[PermissionSet(SecurityAction.InheritanceDemand, Name="FullTrust")]
public class CompilerResults {
private CompilerErrorCollection errors = new CompilerErrorCollection();
private StringCollection output = new StringCollection();
private Assembly compiledAssembly;
private string pathToAssembly;
private int nativeCompilerReturnValue;
private TempFileCollection tempFiles;
private Evidence evidence;
///
///
/// Initializes a new instance of
/// that uses the specified
/// temporary files.
///
///
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
public CompilerResults(TempFileCollection tempFiles) {
this.tempFiles = tempFiles;
}
///
///
/// Gets or sets the temporary files to use.
///
///
public TempFileCollection TempFiles {
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
get {
return tempFiles;
}
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
set {
tempFiles = value;
}
}
///
///
/// Set the evidence for partially trusted scenarios.
///
///
[Obsolete("CAS policy is obsolete and will be removed in a future release of the .NET Framework. Please see http://go2.microsoft.com/fwlink/?LinkId=131738 for more information.")]
public Evidence Evidence {
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
get {
Evidence e = null;
if (evidence != null)
e = evidence.Clone();
return e;
}
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
[SecurityPermissionAttribute( SecurityAction.Demand, ControlEvidence = true )]
set {
if (value != null)
evidence = value.Clone();
else
evidence = null;
}
}
///
///
/// The compiled assembly.
///
///
public Assembly CompiledAssembly {
[SecurityPermissionAttribute(SecurityAction.Assert, Flags=SecurityPermissionFlag.ControlEvidence)]
[ResourceExposure(ResourceScope.None)]
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
get {
if (compiledAssembly == null && pathToAssembly != null) {
AssemblyName assemName = new AssemblyName();
assemName.CodeBase = pathToAssembly;
#pragma warning disable 618 // Load with evidence is obsolete - this warning is passed on via the Evidence property
compiledAssembly = Assembly.Load(assemName,evidence);
#pragma warning restore 618
}
return compiledAssembly;
}
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
set {
compiledAssembly = value;
}
}
///
///
/// Gets or sets the collection of compiler errors.
///
///
public CompilerErrorCollection Errors {
get {
return errors;
}
}
///
///
/// Gets or sets the compiler output messages.
///
///
public StringCollection Output {
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
get {
return output;
}
}
///
///
/// Gets or sets the path to the assembly.
///
///
public string PathToAssembly {
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
[ResourceExposure(ResourceScope.Machine)]
get {
return pathToAssembly;
}
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
[ResourceExposure(ResourceScope.Machine)]
set {
pathToAssembly = value;
}
}
///
///
/// Gets or sets the compiler's return value.
///
///
public int NativeCompilerReturnValue {
get {
return nativeCompilerReturnValue;
}
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
set {
nativeCompilerReturnValue = value;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UiaCoreApi.cs
- WithStatement.cs
- InternalMappingException.cs
- PseudoWebRequest.cs
- FixedSOMPageElement.cs
- TemplateColumn.cs
- Vector3DAnimationBase.cs
- NestedContainer.cs
- ImportCatalogPart.cs
- HttpMethodAttribute.cs
- WindowsListViewGroupSubsetLink.cs
- SynchronizationValidator.cs
- ValidatedControlConverter.cs
- PropertyBuilder.cs
- Action.cs
- ReceiveContextCollection.cs
- ChooseAction.cs
- MenuItem.cs
- BaseDataBoundControlDesigner.cs
- RequestQueryProcessor.cs
- TraceData.cs
- Walker.cs
- ItemContainerProviderWrapper.cs
- DataRecordObjectView.cs
- sqlstateclientmanager.cs
- XmlILStorageConverter.cs
- BasicCommandTreeVisitor.cs
- NamedPipeChannelListener.cs
- Latin1Encoding.cs
- NullableConverter.cs
- fixedPageContentExtractor.cs
- CodeIdentifiers.cs
- DesignColumnCollection.cs
- CallSite.cs
- UpDownEvent.cs
- HttpHeaderCollection.cs
- Command.cs
- ChooseAction.cs
- _SpnDictionary.cs
- EntityConnectionStringBuilderItem.cs
- UnknownBitmapDecoder.cs
- MimePart.cs
- XAMLParseException.cs
- EarlyBoundInfo.cs
- TCPListener.cs
- GetImportedCardRequest.cs
- TrustLevel.cs
- DataGridViewColumnConverter.cs
- RegexTypeEditor.cs
- CodeIterationStatement.cs
- SchemaTableColumn.cs
- ExpressionEditorAttribute.cs
- NotImplementedException.cs
- AttributeConverter.cs
- CodeDefaultValueExpression.cs
- SignerInfo.cs
- CultureSpecificStringDictionary.cs
- PagedDataSource.cs
- TextControlDesigner.cs
- SimpleBitVector32.cs
- UIHelper.cs
- WebPartDescription.cs
- EditorZone.cs
- TaskCanceledException.cs
- ExtensionFile.cs
- WSHttpBindingBaseElement.cs
- HtmlInputControl.cs
- CompilerGeneratedAttribute.cs
- EntitySqlQueryCacheEntry.cs
- httpstaticobjectscollection.cs
- CharUnicodeInfo.cs
- SR.cs
- EdmSchemaAttribute.cs
- XPathDocumentNavigator.cs
- MailMessageEventArgs.cs
- CustomSignedXml.cs
- XmlSchemaAttributeGroupRef.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- Propagator.cs
- ConnectionStringsExpressionBuilder.cs
- ListGeneralPage.cs
- RegexMatch.cs
- RuleSetBrowserDialog.cs
- ServiceDescriptions.cs
- CubicEase.cs
- IndependentlyAnimatedPropertyMetadata.cs
- ExtenderHelpers.cs
- HtmlInputFile.cs
- WindowsRichEditRange.cs
- InputLangChangeEvent.cs
- WebPartConnectionsCancelEventArgs.cs
- MdiWindowListStrip.cs
- ContainerVisual.cs
- LambdaCompiler.Lambda.cs
- UnSafeCharBuffer.cs
- ParserStack.cs
- ExtensionQuery.cs
- XmlTextWriter.cs
- SapiGrammar.cs
- ReaderWriterLock.cs