OKIEWARDOYO

C#.NET No.11-4

Dec 21st, 2012
3,595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1. using System;
  2.  
  3. class BasicAttributeDemo
  4. {
  5.     [Obsolete]
  6.     public void MyFirstdeprecatedMethod()
  7.     {
  8.         Console.WriteLine("Called MyFirstdeprecatedMethod().");
  9.     }
  10.  
  11.     [ObsoleteAttribute]
  12.     public void MySecondDeprecatedMethod()
  13.     {
  14.         Console.WriteLine("Called MySecondDeprecatedMethod().");
  15.     }
  16.  
  17.     [Obsolete("You shouldn't use this method anymore.")]
  18.     public void MyThirdDeprecatedMethod()
  19.     {
  20.         Console.WriteLine("Called MyThirdDeprecatedMethod().");
  21.     }
  22.  
  23.     // make the program thread safe for COM
  24.     [STAThread]
  25.     static void Main(string[] args)
  26.     {
  27.         BasicAttributeDemo attrDemo = new BasicAttributeDemo();
  28.  
  29.         attrDemo.MyFirstdeprecatedMethod();
  30.         attrDemo.MySecondDeprecatedMethod();
  31.         attrDemo.MyThirdDeprecatedMethod();
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment