Obsolete attribute : attribute « Class « Visual C++ .NET






Obsolete attribute

 
#include "stdafx.h"
using namespace System;

ref class C
{
   public:
     void Method2() {}
    [Obsolete("This method is obsolete; use Method2 instead.")]
     void Method1() {}
};

int main()
{
    C^ c = gcnew C();
    c->Method1();
    c->Method2();
}

   
  








Related examples in the same category

1.Custom attribute
2.Creating Custom attribute
3.Out attribute parameter
4.Use the FlagsAttribute