ApplicationIDAttribute Classe

Definizione

Specifica l'ID dell'applicazione sotto forma di GUID per l'assembly. La classe non può essere ereditata.

public ref class ApplicationIDAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, Inherited=true)]
[System.Runtime.InteropServices.ComVisible(false)]
public sealed class ApplicationIDAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, Inherited=true)>]
[<System.Runtime.InteropServices.ComVisible(false)>]
type ApplicationIDAttribute = class
    inherit Attribute
Public NotInheritable Class ApplicationIDAttribute
Inherits Attribute
Ereditarietà
ApplicationIDAttribute
Attributi

Esempio

Nell'esempio di codice seguente viene illustrato l'uso ApplicationIDAttribute del tipo.

using System;
using System.EnterpriseServices;
using System.Reflection;

// References:
// System.EnterpriseServices

// The GUID (Globally Unique Identifier) shown below is for example purposes
// only and should be replaced by a GUID that you have generated.
[assembly: ApplicationID("727FC170-1D80-4e89-84CC-22AAB10A6F24")]

public class ApplicationIDAttribute_Value : ServicedComponent
{
    public void ValueExample()
    {
        // Get the ApplicationIDAttribute applied to the assembly.
        ApplicationIDAttribute attribute =
            (ApplicationIDAttribute)Attribute.GetCustomAttribute(
            System.Reflection.Assembly.GetExecutingAssembly(),
            typeof(ApplicationIDAttribute),
            false);

        // Display the value of the attribute's Value property.
        Console.WriteLine("ApplicationIDAttribute.Value: {0}",
            attribute.Value);
    }
}
Imports System.EnterpriseServices
Imports System.Reflection


' References:
' System.EnterpriseServices

' The GUID (Globally Unique Identifier) shown below is for example purposes
' only and should be replaced by a GUID that you have generated.
<Assembly: ApplicationID("727FC170-1D80-4e89-84CC-22AAB10A6F24")> 

Public Class ApplicationIDAttribute_Value
    Inherits ServicedComponent
    
    Public Sub ValueExample() 
        ' Get the ApplicationIDAttribute applied to the assembly.
        Dim attribute As ApplicationIDAttribute = CType(Attribute.GetCustomAttribute(System.Reflection.Assembly.GetExecutingAssembly(), GetType(ApplicationIDAttribute), False), ApplicationIDAttribute)
        
        ' Display the value of the attribute's Value property.
        MsgBox("ApplicationIDAttribute.Value: " & attribute.Value.ToString())

    End Sub
End Class

Commenti

ApplicationIDAttribute accetta un GUID nel relativo costruttore. Quando si verifica la registrazione, i componenti dell'assembly vengono installati in un'applicazione con l'ID specificato.

Costruttori

ApplicationIDAttribute(String)

Consente di inizializzare una nuova istanza della classe ApplicationIDAttribute che specifica il GUID che rappresenta l'ID dell'applicazione COM+.

Proprietà

TypeId

Quando è implementata in una classe derivata, ottiene un identificatore univoco della classe Attribute.

(Ereditato da Attribute)
Value

Ottiene il GUID dell'applicazione COM+.

Metodi

Equals(Object)

Restituisce un valore che indica se questa istanza è uguale a un oggetto specificato.

(Ereditato da Attribute)
GetHashCode()

Restituisce il codice hash per l'istanza.

(Ereditato da Attribute)
GetType()

Ottiene l'oggetto Type dell'istanza corrente.

(Ereditato da Object)
IsDefaultAttribute()

In caso di override in una classe derivata, indica se il valore di questa istanza è il valore predefinito per la classe derivata.

(Ereditato da Attribute)
Match(Object)

Quando è sottoposto a override in una classe derivata, restituisce un valore che indica se questa istanza equivale a un oggetto specificato.

(Ereditato da Attribute)
MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Implementazioni dell'interfaccia esplicita

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Esegue il mapping di un set di nomi a un set corrispondente di ID dispatch.

(Ereditato da Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Recupera le informazioni sul tipo relative a un oggetto, che possono essere usate per ottenere informazioni sul tipo relative a un'interfaccia.

(Ereditato da Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Recupera il numero delle interfacce di informazioni sul tipo fornite da un oggetto (0 o 1).

(Ereditato da Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fornisce l'accesso a proprietà e metodi esposti da un oggetto.

(Ereditato da Attribute)

Si applica a