AssemblyDescriptionAttribute Classe

Definizione

Fornisce la descrizione testuale di un assembly.

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

Esempio

L'esempio di codice seguente imposta l'oggetto AssemblyDescriptionAttribute per un assembly semplice e indica se è stato definito o meno.

using System;
using System.Reflection;

[assembly:AssemblyDescriptionAttribute("My Utility")]
public class Test {

    public static void Main()
    {
        //  Get the assembly.
        Assembly asm = Assembly.GetCallingAssembly();

        //  Verify that the description is applied.
        Type aType = typeof(AssemblyDescriptionAttribute);
        Console.WriteLine("Description applied: {0}",
            asm.IsDefined(aType, false));
    }
}
//  The output is:
//  Description Applied: True
Imports System.Reflection

<Assembly:AssemblyDescriptionAttribute("My Utility")> 

' Note: The suffix "Attribute" can be omitted:
' <Assembly:AssemblyTitle("A title example")>

Public Class Test
    Public Shared Sub Main()

        ' Get the assembly.
        Dim asm As [Assembly] = [Assembly].GetCallingAssembly

        ' Verify that the description is applied.
        Dim aType As Type = GetType(AssemblyDescriptionAttribute)

        Console.WriteLine("Description applied: {0}", _
            asm.IsDefined(aType, False))

    End Sub
End Class

' The output is:
' Description Applied: True

Commenti

Quando si crea un progetto in Microsoft Visual Studio 2005, questo attributo viene applicato automaticamente con un valore stringa vuoto. È possibile impostare il valore in Visual Studio 2005 selezionando proprietà per il progetto dal menu File e quindi facendo clic su Informazioni assembly. L'attributo viene salvato nel file AssemblyInfo nel progetto e deve essere rimosso prima di poterlo specificare nel codice; in caso contrario, verrà visualizzato un errore che l'attributo non può essere applicato più volte.

Quando si fa clic con il pulsante destro del mouse sul file di assembly in Esplora file, questo attributo viene visualizzato come valore Commenti nella scheda Versione della finestra di dialogo Proprietà file.

Costruttori

AssemblyDescriptionAttribute(String)

Inizializza una nuova istanza della classe AssemblyDescriptionAttribute.

Proprietà

Description

Ottiene le informazioni sulla descrizione dell'assembly.

TypeId

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

(Ereditato da Attribute)

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

Vedi anche