Using Attributes in C# - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Wednesday, June 29, 2011

Using Attributes in C#

Some of the methods in your program will only run under certain conditions.

Enter the line of code that lets you define a symbol called "DEBUGGING".

  MISSING CODE using System;
Result

The symbol is defined with the line #define DEBUGGING.

Step 2 of 4

You decide to use the Conditional intrinsic attribute to mark some methods that will only be used for debugging.

Type the name of the .NET namespace in which the Conditional attribute is defined.

  #define DEBUGGING using System; using MISSING CODE; using System.Runtime.InteropServices; 
Result

You type System.Diagnostics. The Conditional attribute is defined in this namespace.

No comments:

Post a Comment