Visual Studio Tutorials:Qualifying Types


Have you ever read a tutorial on FlatRedBall which references a type, but the tutorial doesn’t include the required “using” statement for qualifying that type? Or perhaps you’ve written code which referenced a type, but you couldn’t remember what the entire namespace for that type was. Fortunately the Visual Studio team has thought of this problem.


Let’s say you are programming and have decided to use the InputManager. Notice that if the class doesn’t include a proper “using” statement, Visual Studio will complain:


Notice that under the “r” of “InputManager” there is a small dark-red rectangle. This indicates that Visual Studio recognizes the type, but that it is not qualified. At this point, you can either move the mouse over the red rectangle, or press CTRL + . (that’s CTRL and the period key):

If clicked with mouse:

If CTRL+.:

If you select the first option (using FlatRedBall.Input;), then that “using” statement will automatically be added for you. If you select the second, then the namespace will be placed in front of your object. I generally prefer simply adding the using statement so I don’t have to worry about any further qualifications for that type.


Your class name will change color indicating that Visual Studio now recognizes the type.