Back to slide -- Keyboard shortcut: 'u'  previous -- Keyboard shortcut: 'p'                io/attributes/1/usage-obsolete.cs - Sample usage of the reproduced class - causes a compilation error.Lecture 10 - slide 36 : 40
Program 4

using System;

[MyObsolete("Use class D instead")]
class C{
  // ...
}

class D{
  [MyObsolete("Do not call this method.",IsError=true)]
  public void M(){
  }
}

class E{
  public static void Main(){
    C c = new C();
    D d = new D();
    d.M();
  }
}