Why do you use an attribute instead of inheriting from an interface? Wouldn’t that be easier implement an interface than adding a whole new concept to C#(attributes)?
Atribute Example:
[Serializable]
public class MyObject {
public int n1 = 0;
public int n2 = 0;
public String str = null;
}
Interface Example:
public class MyObject: ISerializable {
public byte[] getBinaryData() { // some code }
public int n1 = 0;
public int n2 = 0;
public String str = null;
}