ActivationArguments Klasse

Definition

Stellt Daten für die manifestbasierte Aktivierung einer Anwendung bereit. Diese Klasse kann nicht vererbt werden.

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
Vererbung
ActivationArguments
Vererbung
ActivationArguments
Attribute

Beispiele

Das folgende Codebeispiel zeigt, wie sie das aktuelle ActivationArguments Objekt aus dem AppDomainSetup für eine AppDomain manifestbasierte Anwendung abrufen.

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

Hinweise

Die ActivationArguments -Klasse wird von der AppDomainSetup -Klasse verwendet.

Das manifestbasierte Aktivierungsmodell verwendet ein Anwendungsmanifest anstelle einer Assembly für die Aktivierung. Ein Manifest beschreibt vollständig an die Anwendung, seiner Abhängigkeiten, sicherheitsanforderungen usw. Das Manifestmodell hat mehrere Vorteile gegenüber dem assemblybasierten Aktivierungsmodell, insbesondere für Webanwendungen. Das Manifest enthält beispielsweise die Sicherheitsanforderungen der Anwendung, sodass der Benutzer vor dem Herunterladen des Codes entscheiden kann, ob die Anwendung ausgeführt werden soll. Das Manifest enthält auch Informationen zu den Anwendungsabhängigkeiten.

Konstruktoren

ActivationArguments(ActivationContext)

Initialisiert eine neue Instanz der ActivationArguments-Klasse mit dem angegebenen Aktivierungskontext.

ActivationArguments(ActivationContext, String[])

Initialisiert eine neue Instanz der ActivationArguments-Klasse mit dem angegebenen Aktivierungskontext und den Aktivierungsdaten.

ActivationArguments(ApplicationIdentity)

Initialisiert eine neue Instanz der ActivationArguments-Klasse mit der angegebenen Anwendungsidentität.

ActivationArguments(ApplicationIdentity, String[])

Initialisiert eine neue Instanz der ActivationArguments-Klasse mit der angegebenen Anwendungsidentität und den Aktivierungsdaten.

Eigenschaften

ActivationContext

Ruft den Aktivierungskontext für die manifestbasierte Aktivierung einer Anwendung ab.

ActivationData

Ruft Aktivierungsdaten vom Host ab.

ApplicationIdentity

Ruft die Anwendungsidentität für eine mit dem Manifest aktivierte Anwendung ab.

Methoden

Clone()

Erstellt eine Kopie des aktuellen ActivationArguments-Objekts.

Equals(Object)

Bestimmt, ob das angegebene Objekt gleich dem aktuellen Objekt ist.

(Geerbt von Object)
GetHashCode()

Fungiert als Standardhashfunktion.

(Geerbt von Object)
GetType()

Ruft den Type der aktuellen Instanz ab.

(Geerbt von Object)
MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.

(Geerbt von Object)
ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.

(Geerbt von Object)

Gilt für: