AutoCompleteAttribute Classe

Definizione

Contrassegna il metodo con attributi come oggetto AutoComplete. La classe non può essere ereditata.

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

Esempio

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

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

// References:
// System.EnterpriseServices

public class AutoCompleteAttribute_Example : ServicedComponent
{
    [AutoComplete]
    public void AutoCompleteAttribute_Ctor()
    {
    }

    [AutoComplete(true)]
    public void AutoCompleteAttribute_Ctor_Bool()
    {
    }

    [AutoComplete(false)]
    public void AutoCompleteAttribute_Value()
    {
        // Get information on the member.
        System.Reflection.MemberInfo[] memberinfo =
            this.GetType().GetMember(
            "AutoCompleteAttribute_Value");

        // Get the AutoCompleteAttribute applied to the member.
        AutoCompleteAttribute attribute =
            (AutoCompleteAttribute)System.Attribute.GetCustomAttribute(
            memberinfo[0],
            typeof(AutoCompleteAttribute),
            false);

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


' References:
' System.EnterpriseServices

Public Class AutoCompleteAttribute_Example
    Inherits ServicedComponent
    
    <AutoComplete()>  _
    Public Sub AutoCompleteAttribute_Ctor() 
    
    End Sub

    <AutoComplete(True)>  _
    Public Sub AutoCompleteAttribute_Ctor_Bool() 
    
    End Sub

    <AutoComplete(False)>  _
    Public Sub AutoCompleteAttribute_Value() 
        ' Get information on the member.
        Dim memberinfo As System.Reflection.MemberInfo() = Me.GetType().GetMember("AutoCompleteAttribute_Value")
        
        ' Get the AutoCompleteAttribute applied to the member.
        Dim attribute As AutoCompleteAttribute = CType(System.Attribute.GetCustomAttribute(memberinfo(0), GetType(AutoCompleteAttribute), False), AutoCompleteAttribute)
        
        ' Display the value of the attribute's Value property.
        MsgBox("AutoCompleteAttribute.Value: " & attribute.Value)
    
    End Sub

End Class

Commenti

Se viene specificato, non deve essere disabilitato nel catalogo COM+. Se AutoComplete abilitato nel catalogo COM+, deve essere specificato nel componente.

La transazione chiama SetComplete automaticamente se la chiamata al metodo restituisce normalmente. Se la chiamata al metodo genera un'eccezione, la transazione viene interrotta.

Costruttori

AutoCompleteAttribute()

Consente di inizializzare una nuova istanza della classe AutoCompleteAttribute, specificando che l'applicazione deve chiamare automaticamente SetComplete() se la transazione viene completata.

AutoCompleteAttribute(Boolean)

Consente di inizializzare una nuova istanza della classe AutoCompleteAttribute, specificando l'attivazione di AutoComplete in COM+.

Proprietà

TypeId

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

(Ereditato da Attribute)
Value

Ottiene un valore che indica l'impostazione dell'opzione AutoComplete in 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