TagNameAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供強型別計量的標記資訊。
public ref class TagNameAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)]
public sealed class TagNameAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)>]
type TagNameAttribute = class
inherit Attribute
Public NotInheritable Class TagNameAttribute
Inherits Attribute
- 繼承
- 屬性
範例
public class MyStrongTypeMetric
{
[TagName("tag_name_as_per_some_convention1")]
public string Name1 { get; set; }
[TagName("tag_name_as_per_some_convention2")]
public string Name2;
}
備註
此屬性套用於度量類別的欄位或屬性,以覆蓋預設標籤名稱。 預設情況下,標籤名稱與相應欄位或屬性相同。 你可以用這個屬性來覆寫預設值並提供自訂標籤名稱。
建構函式
| 名稱 | Description |
|---|---|
| TagNameAttribute(String) |
初始化 TagNameAttribute 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| Name |
會拿到標籤的名字。 |