C#

System.Obsolete 더이상 사용하지 않는 소스를 표시할때

탑~! 2018. 9. 6. 12:25
using System;

public sealed class App {
   static void Main() {      
      // The line below causes the compiler to issue a warning:
      // 'App.SomeDeprecatedMethod()' is obsolete: 'Do not call this method.'
      SomeDeprecatedMethod();
   }

   // The method below is marked with the ObsoleteAttribute. 
   // Any code that attempts to call this method will get a warning.
   [Obsolete("Do not call this method.")]
   private static void SomeDeprecatedMethod() { } 

}



출처: http://flystone.tistory.com/82?category=410122 [MomO]