code_junkie

Custom Compiler Warnings

Nov 11th, 2011
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. [MyAttribute("This code sux and should be looked at")]
  2. public sub DoEverything(){}
  3.  
  4. [Obsolete("Should be refactored")]
  5. public class MustRefactor: System.Attribute{}
  6.  
  7. #warning "Do not use ABC, which is deprecated. Use XYZ instead."
  8.  
  9. #pragma message ( "text" )
  10.  
  11. public void DoEverything() {
  12. #warning "This code sucks"
  13. }
  14.  
  15. [Obsolete("Mapping ToDo")]
  16. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)]
  17. public class MappingToDo : System.Attribute
  18. {
  19. public string Comment = "";
  20.  
  21. public MappingToDo(string comment)
  22. {
  23. Comment = comment;
  24. }
  25.  
  26. public MappingToDo()
  27. {}
  28. }
  29.  
  30. [MappingToDo("Some comment")]
  31. public class MembershipHour : Entity
  32. {
  33. // .....
  34. }
Add Comment
Please, Sign In to add comment