Scenario: Consider that u want to use a class but u don't know under which namespace the class belong.
Here the solution: keep the cursor on the class that u r using and press 'Alt+Shift+F10' a new popup menu will occur which will show the namespace just click on the popup menu the name space will automatically added in the starting of ur code.
Example:
using System;
Regex clsReg = new Regex(); here Regex is a class which comes under System.Text.RegularExpressions namespace but u didnt include it in ur code
now keep the cursor on Regex and press alt+shit+F10 a popup menu will occur like the below image.
then click the using System.Text.RegularExpressions;
now u go and see the starting page of ur code.
Note: This technique will workout for all the built in classes also for the classes which are added in the reference.
Automatically adding namespace
Posted by
Nirmal
Thursday, July 31, 2008
Labels: C#
0 comments:
Post a Comment