ApplicationIDAttribute 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.
Anger program-ID :t (som ett GUID) för den här sammansättningen. Det går inte att ärva den här klassen.
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
- Arv
- Attribut
Exempel
I följande kodexempel visas användningen av ApplicationIDAttribute typen.
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
Kommentarer
ApplicationIDAttribute tar ett GUID i konstruktorn. När registreringen sker installeras komponenterna i sammansättningen i ett program med det angivna ID:t.
Konstruktorer
| Name | Description |
|---|---|
| ApplicationIDAttribute(String) |
Initierar en ny instans av ApplicationIDAttribute klassen som anger DET GUID som representerar program-ID:t för COM+-programmet. |
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 GUID för COM+-programmet. |
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) |