Skip to main content
A newer version of this page is available. .

Declare Menu

The Declare menu allows you to add a members group to your types. You can use the Declare Menu to generate a pattern, change/overload base class members, etc.

Declare_Main

How to Use

  1. Place the caret in a member definition and press Alt+Insert.

The Declare menu appears.

Invoke

  1. Choose the action from the menu (for example, Properties) and press Enter.

Choose

  1. Use the mouse or Space key to select members for which to generate properties.

Declare_2

  1. Press Ctrl to open the Options menu (optionally).
  • Use the mouse or corresponding letter keys listed in the menu to change options.

Options

  • Press Enter to close the menu.
  1. Press Enter to confirm the selection and perform the declaration.

The code snippet below shows the declared property.


public class Temperature {

    int fahrenheit;
    int celcius;
    internal int Fahrenheit {
        get
        {
            return fahrenheit;
        }

        set
        {
            fahrenheit = value;
        }
    }
}

Declare Items

The Declare menu supports the following actions: