[Tip] Namespaces / Visual Studio

When you come to adding your classes to namespaces you can make this a little bit easier by using the Surround With… functionality within Visual Studio.

The following example is taken from the PlayerMovement.cs file.


Example;

  • Collapse your code at the class level

  • Select the collapsed code, including any attributes , right-click* and select Surround Width…

  • Enter the first few characters of namespace to filter the snippets

  • Select namespace from the list of snippets

  • Replace MyNameSpace with the desired text



* if you prefer, you can use CTRL + K CTRL + S to launch this menu


See also;

2 Likes

Damn I wish I saw this yesterday! Thanks Rob :slight_smile:

1 Like

Hi @James_E,

Always the way! Glad someone found this useful anyway :slight_smile:

Privacy & Terms