| // In part, reproduced from the book "C# to the Point"
using System;
[AttributeUsage(AttributeTargets.Method |
AttributeTargets.Property)]
public sealed class MyObsoleteAttribute: Attribute{
string message;
bool isError;
public string Message{
get {
return message;
}
}
public bool IsError{
get {
return isError;
}
set {
isError = value;
}
}
public MyObsoleteAttribute(){
message = ""; isError = false;
}
public MyObsoleteAttribute(string msg){
message = msg; isError = false;
}
public MyObsoleteAttribute(string msg, bool error){
message = msg; isError = error;
}
} |