
























Attributs其实是一种标记,他在编译器编译时告诉编译器进行一些工作,比如对后面的函数进行序列化以便远程执行等,大多用于转换信息用。这种技术比较先进,减轻了代码量,使逻辑更加清楚。也可以自定义Attributs:
[AttributeUsage(AttributeTargets.Method)]
public class MyAttribute: System.Attribute
{ ... }
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class MyAttribute: System.Attribute
{ ... }
常用属性种类
General attributes
lCOM interoperability attributes
lTransaction handling attributes
lVisual designer component building attributes
l
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。