that adds a field called
, which can be
used to hold a supplemental remark:
[AttributeUsage(AttributeTargets.All)]
public class RemarkAttribute : Attribute {
string pri_remark; // underlies Remark property
// This can be used as a named parameter:
public string Supplement;
public RemarkAttribute(string comment) {
pri_remark = comment;
Supplement = "None";
}
get {
return pri_remark;
www.freepdf-books.com
P a r t I :
As you can see,
is initialized to the string “None” by the constructor. There
is no way of using the constructor to assign it a different initial value. However, because