The project was updated today, and a new class was created to replace the original work. But do not want to delete, once deleted on the SVN will not exist. Decide whether to use obsolete to sign the code out of date.
Introduction to the obsolete tag on MSDN
Https://msdn.microsoft.com/zh-cn/library/22kk2b44%28VS.80%29.aspx
The Obsolete property marks a program entity as an entity that is not recommended for use. Each time you use an entity that is marked as obsolete, a warning or error is subsequently generated, depending on how the property is configured.
Obsolete tags for classes, functions, respectively, in the sample code
Using system;using system.collections.generic;using system.linq;using system.text;using System.Threading.Tasks; namespace obsoletetest{ [Obsolete ("A was Obsolete,use C")] class a{} [Obsolete ("B is Obsolete,use C", true)] class b{} class c{} class program { [Obsolete ("Funca is Obsolete,use FunC")] static void Funca () {} [Obsolete ("FUNCB is Obsolete,use FunC", true)] static void Funcb () {} static void Funcc () {}
static void Main (string[] args) { Funca (); FUNCB (); A = new A (); b b = new B ();}}}
After compiling, vs prompts for errors and warnings
Copyright NOTICE: This article transferred from Http://blog.csdn.net/huutu Reprint please take the http://www.thisisgame.com.cn
Using the OBSOLETE Flag code in C # expires