日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > C# >内容正文

C#

C#特性 - 译

發(fā)布時間:2025/4/14 C# 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 C#特性 - 译 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/concepts/attributes/

Attributes (C#)
特性 (C#)

metadata
元數(shù)據(jù)

declarative information
聲明性信息

assemblies
程序集

types
類型

methods
方法

properties
屬性

so forth
等等

program entity
程序?qū)嶓w

is associated with

和…聯(lián)系在一起;與…有關(guān)

?

at run time
在運行時

a technique called reflection
一項叫反射的技術(shù)

add metadata to your program
添加元數(shù)據(jù)到程序

.NET assemblies
.NET 程序集

a specified set of metadata
一組指定的元數(shù)據(jù)

types and type members
類型和類型成員

custom attributes
自定義特性

smaller program elements
較小的程序元素

classes and properties.
類和屬性

in the same way
adv.?? ?同樣

methods and properties
方法和屬性

?

be placed on
附加到


declaration
聲明

specify an attribute by placing the name of the attribute enclosed in square brackets ([])
通過用方括號 ([]) 將特性名稱括起來

square brackets
n:方括號

?

?

使用特性,可以有效地將元數(shù)據(jù)或聲明性信息與代碼(程序集、類型、方法、屬性等)相關(guān)聯(lián)。?
特性是指類似如下代碼;

[Serializable]
public class SampleClass
{
? ? // Objects of this type can be serialized.
}

[Conditional("DEBUG"), Conditional("TEST1")]
void TraceMethod()
{
? ? // ...
}

總結(jié)

以上是生活随笔為你收集整理的C#特性 - 译的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。