Freigeben über


AutoCompleteAttribute-Klasse

Kennzeichnet die attributierte Methode als ein AutoComplete-Objekt. Diese Klasse kann nicht vererbt werden.

Namespace: System.EnterpriseServices
Assembly: System.EnterpriseServices (in system.enterpriseservices.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Method, Inherited:=True)> _
<ComVisibleAttribute(False)> _
Public NotInheritable Class AutoCompleteAttribute
    Inherits Attribute
'Usage
Dim instance As AutoCompleteAttribute
[AttributeUsageAttribute(AttributeTargets.Method, Inherited=true)] 
[ComVisibleAttribute(false)] 
public sealed class AutoCompleteAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Method, Inherited=true)] 
[ComVisibleAttribute(false)] 
public ref class AutoCompleteAttribute sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Method, Inherited=true) */ 
/** @attribute ComVisibleAttribute(false) */ 
public final class AutoCompleteAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Method, Inherited=true) 
ComVisibleAttribute(false) 
public final class AutoCompleteAttribute extends Attribute

Hinweise

Wenn AutoComplete angegeben ist, darf es im COM+-Katalog nicht deaktiviert sein, und wenn es im COM+-Katalog aktiviert ist, muss es für die Komponente angegeben sein.

Wenn der Methodenaufruf regulär zurückgegeben wird, ruft die Transaktion automatisch SetComplete auf. Wenn der Methodenaufruf eine Ausnahme auslöst, wird die Transaktion abgebrochen.

Beispiel

Im folgenden Codebeispiel wird die Verwendung des AutoCompleteAttribute-Typs veranschaulicht.

Imports System
Imports System.EnterpriseServices
Imports System.Reflection


' References:
' System.EnterpriseServices

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

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

    <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 'AutoCompleteAttribute_Value

End Class 'AutoCompleteAttribute_Example
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);
    }
}
import System.*;
import System.EnterpriseServices.*;
import System.Reflection.*;

// References:
// System.EnterpriseServices
public class AutoCompleteAttribute_Example extends ServicedComponent
{
    /** @attribute AutoComplete()
     */
    public void AutoCompleteAttribute_Ctor()
    {
    } //AutoCompleteAttribute_Ctor

    /** @attribute AutoComplete(true)
     */
    public void AutoCompleteAttribute_Ctor_Bool()
    {
    } //AutoCompleteAttribute_Ctor_Bool

    /** @attribute 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], AutoCompleteAttribute.class.ToType(), false));

        // Display the value of the attribute's Value property.
        Console.WriteLine("AutoCompleteAttribute.Value: {0}",
            System.Convert.ToString(attribute.get_Value()));
    } //AutoCompleteAttribute_Value
} //AutoCompleteAttribute_Example 

Vererbungshierarchie

System.Object
   System.Attribute
    System.EnterpriseServices.AutoCompleteAttribute

Threadsicherheit

Alle öffentlichen statischen (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

AutoCompleteAttribute-Member
System.EnterpriseServices-Namespace