Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / ActivationArguments.cs / 1305376 / ActivationArguments.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System.Diagnostics.Contracts; using System.Runtime.Versioning; using System.Security.Policy; namespace System.Runtime.Hosting { [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public sealed class ActivationArguments : EvidenceBase { private ActivationArguments () {} // This boolean is used to smuggle the information about whether // AppDomainSetup was constructed from an ActivationContext. private bool m_useFusionActivationContext = false; internal bool UseFusionActivationContext { get { return m_useFusionActivationContext; } } // This is used to indicate whether the instance is to be activated // during the new domain's initialization. CreateInstanceHelper sets // this flag to true; CreateDomainHelper never activates the application. private bool m_activateInstance = false; internal bool ActivateInstance { get { return m_activateInstance; } set { m_activateInstance = value; } } private string m_appFullName; internal string ApplicationFullName { get { return m_appFullName; } } private string[] m_appManifestPaths; internal string[] ApplicationManifestPaths { get { return m_appManifestPaths; } } #if !FEATURE_PAL public ActivationArguments (ApplicationIdentity applicationIdentity) : this (applicationIdentity, null) {} public ActivationArguments (ApplicationIdentity applicationIdentity, string[] activationData) { if (applicationIdentity == null) throw new ArgumentNullException("applicationIdentity"); Contract.EndContractBlock(); m_appFullName = applicationIdentity.FullName; m_activationData = activationData; } public ActivationArguments (ActivationContext activationData) : this (activationData, null) {} [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] public ActivationArguments (ActivationContext activationContext, string[] activationData) { if (activationContext == null) throw new ArgumentNullException("activationContext"); Contract.EndContractBlock(); m_appFullName = activationContext.Identity.FullName; m_appManifestPaths = activationContext.ManifestPaths; m_activationData = activationData; m_useFusionActivationContext = true; } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] internal ActivationArguments (string appFullName, string[] appManifestPaths, string[] activationData) { if (appFullName == null) throw new ArgumentNullException("appFullName"); Contract.EndContractBlock(); m_appFullName = appFullName; m_appManifestPaths = appManifestPaths; m_activationData = activationData; m_useFusionActivationContext = true; } public ApplicationIdentity ApplicationIdentity { get { return new ApplicationIdentity(m_appFullName); } } public ActivationContext ActivationContext { [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] get { if (!UseFusionActivationContext) return null; if (m_appManifestPaths == null) return new ActivationContext(new ApplicationIdentity(m_appFullName)); else return new ActivationContext(new ApplicationIdentity(m_appFullName), m_appManifestPaths); } } #endif // !FEATURE_PAL private string[] m_activationData; public string[] ActivationData { get { return m_activationData; } } public override EvidenceBase Clone() { ActivationArguments clone = new ActivationArguments(); clone.m_useFusionActivationContext = m_useFusionActivationContext; clone.m_activateInstance = m_activateInstance; clone.m_appFullName = m_appFullName; if (m_appManifestPaths != null) { clone.m_appManifestPaths = new string[m_appManifestPaths.Length]; Array.Copy(m_appManifestPaths, clone.m_appManifestPaths, clone.m_appManifestPaths.Length); } if (m_activationData != null) { clone.m_activationData = new string[m_activationData.Length]; Array.Copy(m_activationData, clone.m_activationData, clone.m_activationData.Length); } #if !FEATURE_PAL clone.m_activateInstance = m_activateInstance; clone.m_appFullName = m_appFullName; clone.m_useFusionActivationContext = m_useFusionActivationContext; #endif // !FEATURE_PAL return clone; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System.Diagnostics.Contracts; using System.Runtime.Versioning; using System.Security.Policy; namespace System.Runtime.Hosting { [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public sealed class ActivationArguments : EvidenceBase { private ActivationArguments () {} // This boolean is used to smuggle the information about whether // AppDomainSetup was constructed from an ActivationContext. private bool m_useFusionActivationContext = false; internal bool UseFusionActivationContext { get { return m_useFusionActivationContext; } } // This is used to indicate whether the instance is to be activated // during the new domain's initialization. CreateInstanceHelper sets // this flag to true; CreateDomainHelper never activates the application. private bool m_activateInstance = false; internal bool ActivateInstance { get { return m_activateInstance; } set { m_activateInstance = value; } } private string m_appFullName; internal string ApplicationFullName { get { return m_appFullName; } } private string[] m_appManifestPaths; internal string[] ApplicationManifestPaths { get { return m_appManifestPaths; } } #if !FEATURE_PAL public ActivationArguments (ApplicationIdentity applicationIdentity) : this (applicationIdentity, null) {} public ActivationArguments (ApplicationIdentity applicationIdentity, string[] activationData) { if (applicationIdentity == null) throw new ArgumentNullException("applicationIdentity"); Contract.EndContractBlock(); m_appFullName = applicationIdentity.FullName; m_activationData = activationData; } public ActivationArguments (ActivationContext activationData) : this (activationData, null) {} [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] public ActivationArguments (ActivationContext activationContext, string[] activationData) { if (activationContext == null) throw new ArgumentNullException("activationContext"); Contract.EndContractBlock(); m_appFullName = activationContext.Identity.FullName; m_appManifestPaths = activationContext.ManifestPaths; m_activationData = activationData; m_useFusionActivationContext = true; } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] internal ActivationArguments (string appFullName, string[] appManifestPaths, string[] activationData) { if (appFullName == null) throw new ArgumentNullException("appFullName"); Contract.EndContractBlock(); m_appFullName = appFullName; m_appManifestPaths = appManifestPaths; m_activationData = activationData; m_useFusionActivationContext = true; } public ApplicationIdentity ApplicationIdentity { get { return new ApplicationIdentity(m_appFullName); } } public ActivationContext ActivationContext { [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] get { if (!UseFusionActivationContext) return null; if (m_appManifestPaths == null) return new ActivationContext(new ApplicationIdentity(m_appFullName)); else return new ActivationContext(new ApplicationIdentity(m_appFullName), m_appManifestPaths); } } #endif // !FEATURE_PAL private string[] m_activationData; public string[] ActivationData { get { return m_activationData; } } public override EvidenceBase Clone() { ActivationArguments clone = new ActivationArguments(); clone.m_useFusionActivationContext = m_useFusionActivationContext; clone.m_activateInstance = m_activateInstance; clone.m_appFullName = m_appFullName; if (m_appManifestPaths != null) { clone.m_appManifestPaths = new string[m_appManifestPaths.Length]; Array.Copy(m_appManifestPaths, clone.m_appManifestPaths, clone.m_appManifestPaths.Length); } if (m_activationData != null) { clone.m_activationData = new string[m_activationData.Length]; Array.Copy(m_activationData, clone.m_activationData, clone.m_activationData.Length); } #if !FEATURE_PAL clone.m_activateInstance = m_activateInstance; clone.m_appFullName = m_appFullName; clone.m_useFusionActivationContext = m_useFusionActivationContext; #endif // !FEATURE_PAL return clone; } } } // 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
- ExecutionContext.cs
- Tool.cs
- CompilerScope.Storage.cs
- WinEventTracker.cs
- NativeCompoundFileAPIs.cs
- CompiledIdentityConstraint.cs
- HiddenField.cs
- PackageDigitalSignature.cs
- ResourceCodeDomSerializer.cs
- CharacterBufferReference.cs
- CngKeyBlobFormat.cs
- OpCodes.cs
- DefaultWorkflowSchedulerService.cs
- NameValueSectionHandler.cs
- RotateTransform3D.cs
- WebPartAddingEventArgs.cs
- SiteMapDataSource.cs
- CodeChecksumPragma.cs
- Latin1Encoding.cs
- QueryRewriter.cs
- DataView.cs
- CodeTypeParameterCollection.cs
- SmtpNetworkElement.cs
- ResolvedKeyFrameEntry.cs
- DynamicILGenerator.cs
- DrawListViewColumnHeaderEventArgs.cs
- AppPool.cs
- BindingWorker.cs
- unsafenativemethodstextservices.cs
- DefaultPropertiesToSend.cs
- BuiltInPermissionSets.cs
- PolicyException.cs
- DynamicQueryableWrapper.cs
- DataGrid.cs
- SymbolTable.cs
- ConversionHelper.cs
- OrderPreservingPipeliningMergeHelper.cs
- SourceChangedEventArgs.cs
- HtmlMeta.cs
- Transform3D.cs
- Parser.cs
- Pkcs9Attribute.cs
- FramingFormat.cs
- DataControlFieldCollection.cs
- UiaCoreApi.cs
- CreateUserWizardStep.cs
- TransformerConfigurationWizardBase.cs
- connectionpool.cs
- unitconverter.cs
- ProcessThread.cs
- EpmSourceTree.cs
- TriggerAction.cs
- SchemaImporterExtensionElement.cs
- OleDbRowUpdatingEvent.cs
- UserControl.cs
- HostedElements.cs
- ParameterReplacerVisitor.cs
- DrawingVisualDrawingContext.cs
- _AutoWebProxyScriptEngine.cs
- System.Data.OracleClient_BID.cs
- Operators.cs
- XsltOutput.cs
- Fonts.cs
- Transform3DGroup.cs
- ObjectDataSourceMethodEditor.cs
- ScriptingScriptResourceHandlerSection.cs
- HuffmanTree.cs
- InheritedPropertyChangedEventArgs.cs
- DataGridPageChangedEventArgs.cs
- SafeLibraryHandle.cs
- XamlRtfConverter.cs
- MimeParameters.cs
- ApplicationHost.cs
- QueryStringParameter.cs
- ProcessProtocolHandler.cs
- ChannelReliableSession.cs
- DateTimeFormatInfoScanner.cs
- SystemParameters.cs
- CustomValidator.cs
- Empty.cs
- StretchValidation.cs
- Pens.cs
- TraceData.cs
- UrlPath.cs
- StateWorkerRequest.cs
- Simplifier.cs
- AudioDeviceOut.cs
- ThaiBuddhistCalendar.cs
- XpsColorContext.cs
- KnownIds.cs
- DrawingAttributes.cs
- DrawingBrush.cs
- XMLUtil.cs
- Utility.cs
- SchemaAttDef.cs
- MediaPlayerState.cs
- HttpWebRequestElement.cs
- UshortList2.cs
- ComboBoxItem.cs
- CriticalFinalizerObject.cs