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

Im folgenden Codebeispiel wird veranschaulicht, wie das aktuelle ActivationArguments Objekt aus der AppDomainSetup für die AppDomain manifestbasierte Anwendung abgerufen wird.

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 die Anwendung, ihre Abhängigkeiten, Sicherheitsanforderungen usw. vollständig. Das Manifestmodell hat mehrere Vorteile gegenüber dem assemblybasierten Aktivierungsmodell, insbesondere für Webanwendungen. Das Manifest enthält beispielsweise die Sicherheitsanforderungen der Anwendung, mit der der Benutzer entscheiden kann, ob die Anwendung vor dem Herunterladen des Codes ausgeführt werden kann. Das Manifest enthält auch Informationen zu den Anwendungsabhängigkeiten.

Konstruktoren

Name Beschreibung
ActivationArguments(ActivationContext, String[])

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

ActivationArguments(ActivationContext)

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

ActivationArguments(ApplicationIdentity, String[])

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

ActivationArguments(ApplicationIdentity)

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

Eigenschaften

Name Beschreibung
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 manifestaktivierte Anwendung ab.

Methoden

Name Beschreibung
Clone()

Erzeugt eine Kopie des aktuellen ActivationArguments Objekts.

Equals(Object)

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

(Geerbt von Object)
GetHashCode()

Dient als Standardhashfunktion.

(Geerbt von Object)
GetType()

Ruft die Type der aktuellen Instanz ab.

(Geerbt von Object)
MemberwiseClone()

Erstellt eine flache Kopie der aktuellen Object.

(Geerbt von Object)
ToString()

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

(Geerbt von Object)

Gilt für: