Conditional Attribute : Attribute : Development C# Examples


C# Examples » Development » Attribute »

 

Conditional Attribute









    
using  System;
using  System.Diagnostics;

class  Program  {
        static  void  Main(string[]  args)  {
                Program.DebugOnly();
        }

        [Conditional("DEBUG")]
        public  static  void  DebugOnly()  {
                Console.WriteLine("This  string  only  displays  in  Debug");
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Attribute