ActivationArguments Klas

Definitie

Biedt gegevens voor activering op basis van manifesten van een toepassing. Deze klasse kan niet worden overgenomen.

public ref class ActivationArguments sealed
public ref class ActivationArguments sealed : System::Security::Policy::EvidenceBase
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class ActivationArguments
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class ActivationArguments : System.Security.Policy.EvidenceBase
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type ActivationArguments = class
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type ActivationArguments = class
    inherit EvidenceBase
Public NotInheritable Class ActivationArguments
Public NotInheritable Class ActivationArguments
Inherits EvidenceBase
Overname
ActivationArguments
Overname
ActivationArguments
Kenmerken

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u het huidige ActivationArguments object van de AppDomainSetup toepassing AppDomain op basis van een manifest kunt verkrijgen.

using System;
using System.Collections;
using System.Text;
using System.Security.Policy;
using System.Reflection;
using System.Security;
using System.Runtime.Hosting;

namespace ActivationContextSample
{
    public class Program : MarshalByRefObject
    {
        public static void Main(string[] args)
        {
            // Get the AppDomainManager from the current domain.
            AppDomainManager domainMgr = AppDomain.CurrentDomain.DomainManager;
            // Get the ApplicationActivator from the AppDomainManager.
            ApplicationActivator appActivator = domainMgr.ApplicationActivator;
            Console.WriteLine("Assembly qualified name from the application activator.");
            Console.WriteLine(appActivator.GetType().AssemblyQualifiedName);
            // Get the ActivationArguments from the SetupInformation property of the domain.
            ActivationArguments activationArgs = AppDomain.CurrentDomain.SetupInformation.ActivationArguments;
            // Get the ActivationContext from the ActivationArguments.
            ActivationContext actContext = activationArgs.ActivationContext;
            Console.WriteLine("The ActivationContext.Form property value is: " +
                activationArgs.ActivationContext.Form);
            Console.Read();
        }
    
        public void Run()
        {
            Main(new string[] { });
            Console.ReadLine();
        }
    }
}
Imports System.Collections
Imports System.Text
Imports System.Security.Policy
Imports System.Reflection
Imports System.Security
Imports System.Security.Permissions
Imports System.Runtime.Hosting



Public Class Program
    Inherits MarshalByRefObject

    <SecurityPermission(SecurityAction.LinkDemand, ControlDomainPolicy:=True)> _
    Public Shared Sub Main(ByVal args() As String)
        ' Get the AppDomainManager from the current domain.
        Dim domainMgr As AppDomainManager = AppDomain.CurrentDomain.DomainManager
        ' Get the ApplicationActivator from the AppDomainManager.
        Dim appActivator As ApplicationActivator = domainMgr.ApplicationActivator
        Console.WriteLine("Assembly qualified name from the application activator.")
        Console.WriteLine(appActivator.GetType().AssemblyQualifiedName)
        Dim ac As ActivationContext = AppDomain.CurrentDomain.ActivationContext
        ' Get the ActivationArguments from the SetupInformation property of the domain.
        Dim activationArgs As ActivationArguments = AppDomain.CurrentDomain.SetupInformation.ActivationArguments
        ' Get the ActivationContext from the ActivationArguments.
        Dim actContext As ActivationContext = activationArgs.ActivationContext
        Console.WriteLine("The ActivationContext.Form property value is: " + _
         activationArgs.ActivationContext.Form.ToString())
        Console.Read()

    End Sub

    <SecurityPermission(SecurityAction.LinkDemand, ControlDomainPolicy:=True)> _
    Public Sub Run()
        Main(New String() {})
        Console.ReadLine()

    End Sub
End Class

Opmerkingen

De ActivationArguments klasse wordt gebruikt door de AppDomainSetup klasse.

Het activeringsmodel op basis van manifest maakt gebruik van een toepassingsmanifest in plaats van een assembly voor activering. Een manifest beschrijft de toepassing, de bijbehorende afhankelijkheden, beveiligingsvereisten, enzovoort. Het manifestmodel heeft verschillende voordelen ten opzichte van het activeringsmodel op basis van assembly, met name voor webtoepassingen. Het manifest bevat bijvoorbeeld de beveiligingsvereisten van de toepassing, waarmee de gebruiker kan bepalen of de toepassing mag worden uitgevoerd voordat de code wordt gedownload. Het manifest bevat ook informatie over de toepassingsafhankelijkheden.

Constructors

Name Description
ActivationArguments(ActivationContext, String[])

Initialiseert een nieuw exemplaar van de ActivationArguments klasse met de opgegeven activeringscontext en activeringsgegevens.

ActivationArguments(ActivationContext)

Initialiseert een nieuw exemplaar van de ActivationArguments klasse met de opgegeven activeringscontext.

ActivationArguments(ApplicationIdentity, String[])

Initialiseert een nieuw exemplaar van de ActivationArguments klasse met de opgegeven toepassings-id en activeringsgegevens.

ActivationArguments(ApplicationIdentity)

Initialiseert een nieuw exemplaar van de ActivationArguments klasse met de opgegeven toepassingsidentiteit.

Eigenschappen

Name Description
ActivationContext

Hiermee haalt u de activeringscontext op voor activering op basis van manifesten van een toepassing.

ActivationData

Hiermee worden activeringsgegevens opgehaald van de host.

ApplicationIdentity

Hiermee haalt u de toepassingsidentiteit op voor een door het manifest geactiveerde toepassing.

Methoden

Name Description
Clone()

Hiermee wordt een kopie van het huidige ActivationArguments object geproduceerd.

Equals(Object)

Bepaalt of het opgegeven object gelijk is aan het huidige object.

(Overgenomen van Object)
GetHashCode()

Fungeert als de standaardhashfunctie.

(Overgenomen van Object)
GetType()

Hiermee haalt u de Type huidige instantie op.

(Overgenomen van Object)
MemberwiseClone()

Hiermee maakt u een ondiepe kopie van de huidige Object.

(Overgenomen van Object)
ToString()

Retourneert een tekenreeks die het huidige object vertegenwoordigt.

(Overgenomen van Object)

Van toepassing op