25.13.txt

来自「《Microsoft Visual C# .NET 2003开发技巧大全》源代码」· 文本 代码 · 共 16 行

TXT
16
字号
Listing 25.13 Using an Attribute That Has an Optional Property
// this class supplies a MaxValue of 100 with the attribute
[FieldAttribute(MaxValue = 100)]
class PercentSuccessfulSales
{
// implementation here
}
// this class is also decorated with the attribute, but does not
// specify a value for MaxValue.
// MaxValue in this attribute will retain its default value of zero
[FieldAttribute()]
class NumberOfVisits
{
// implementation here
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?