AutoCompleteAttribute Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Markerar den tillskrivna metoden som ett AutoComplete objekt. Det går inte att ärva den här klassen.
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
- Arv
- Attribut
Exempel
I följande kodexempel visas användningen av AutoCompleteAttribute typen.
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
Kommentarer
Om AutoComplete anges får den inte inaktiveras i COM+-katalogen. Om den är aktiverad i COM+-katalogen måste den anges på komponenten.
Transaktionen anropar SetComplete automatiskt om metodanropet returnerar normalt. Om metodanropet utlöser ett undantag avbryts transaktionen.
Konstruktorer
| Name | Description |
|---|---|
| AutoCompleteAttribute() |
Initierar en ny instans av AutoCompleteAttribute klassen och anger att programmet automatiskt ska anropas SetComplete() om transaktionen har slutförts. |
| AutoCompleteAttribute(Boolean) |
Initierar en ny instans av AutoCompleteAttribute klassen och anger om COM+ |
Egenskaper
| Name | Description |
|---|---|
| TypeId |
När den implementeras i en härledd klass hämtar du en unik identifierare för den här Attribute. (Ärvd från Attribute) |
| Value |
Hämtar ett värde som anger inställningen för |
Metoder
| Name | Description |
|---|---|
| Equals(Object) |
Returnerar ett värde som anger om den här instansen är lika med ett angivet objekt. (Ärvd från Attribute) |
| GetHashCode() |
Returnerar hash-koden för den här instansen. (Ärvd från Attribute) |
| GetType() |
Hämtar den aktuella instansen Type . (Ärvd från Object) |
| IsDefaultAttribute() |
När den åsidosättas i en härledd klass anger du om värdet för den här instansen är standardvärdet för den härledda klassen. (Ärvd från Attribute) |
| Match(Object) |
När den åsidosätts i en härledd klass returneras ett värde som anger om den här instansen är lika med ett angivet objekt. (Ärvd från Attribute) |
| MemberwiseClone() |
Skapar en ytlig kopia av den aktuella Object. (Ärvd från Object) |
| ToString() |
Returnerar en sträng som representerar det aktuella objektet. (Ärvd från Object) |
Explicita gränssnittsimplementeringar
| Name | Description |
|---|---|
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mappar en uppsättning namn till en motsvarande uppsättning av sändningsidentifierare. (Ärvd från Attribute) |
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Hämtar typinformationen för ett objekt, som kan användas för att hämta typinformationen för ett gränssnitt. (Ärvd från Attribute) |
| _Attribute.GetTypeInfoCount(UInt32) |
Hämtar antalet typinformationsgränssnitt som ett objekt tillhandahåller (antingen 0 eller 1). (Ärvd från Attribute) |
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Ger åtkomst till egenskaper och metoder som exponeras av ett objekt. (Ärvd från Attribute) |