Udostępnij za pośrednictwem


IntelliSense in the Immediate Mode Command Window

IntelliSense can increase your productivity and your ability to discover class members and parameter information while you are debugging in the Immediate Mode command window.

Remarks

IntelliSense in the Immediate Mode command window is only available when debugging is started, and is not available during design time expression evaluation.

Example

This example shows how IntelliSense helps you discover a method named SomeMethod() and its parameter information when you are debugging. In addition, learn how IntelliSense helps you complete the name of this object for typing convenience in the Immediate Mode command window.

Note

The appearance of features in the IDE can depend on your active settings or edition, and might differ from those described in Help. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To set up this example

  1. Create a C# console application, and Visual Studio will automatically open Program.cs in the Code Editor.

  2. Add the following method to Program:

    public int SomeMethod (int i)
    {
       i = i+3;
       return i;
    }
    
  3. Add the following statements to Main(), and then set a breakpoint next to the line in bold:

    Program p1 = new Program();
    int i = 0;
    p1.SomeMethod (i);
    
  4. Select the Start command from the Debug menu.

  5. In the Debug menu, select Windows, and then select the Immediate command (CTRL+D, then I).

    The Immediate Mode command window opens.

  6. Type i and hit ENTER to verify that Immediate Mode is working properly. Immediate Mode evaluates the immediate value of i, and returns 0.

To use IntelliSense in the Immediate Mode command window

  1. Type p1 and then the member-access operator (.); for example:

    p1.
    

    The List Members box appears with a list all of the Program members.

  2. Type S after p1. to begin typing the name of SomeMethod, and then press CTRL+SPACE to execute the Complete Word command. IntelliSense automatically completes the name of the object p1.SomeMethod.

  3. Type an open parenthesis after p1.SomeMethod. IntelliSense displays Parameter Info for p1.SomeMethod.

  4. Type 5) to complete this command, which should appear as follows:

    p1.SomeMethod(5)
    
  5. Press ENTER.

    Immediate Mode returns 8.

The IntelliSense features Quick Info, and pre-selection of members after the new operator, are also available from the Immediate Mode command window.

See Also

Tasks

Modifying IntelliSense Options

Other Resources

Visual C# IntelliSense