Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find another part of PartialClass in Visual Studio IDE?

Suppose I have a partial class in my application.

Let's say I have one part of this class open in Visual Studio and I want to find the other parts. How can I do this? Is there a keyboard shortcut or any other method that I can use to quickly navigate to the other parts of my class?

This would be useful because in a large application, there are so many individual *.cs files that manually searching for partial classes gets very inefficient.

like image 389
Pritesh Avatar asked Oct 12 '11 09:10

Pritesh


People also ask

What is partial class in Visual Studio?

Applies to: Visual Studio Visual Studio for Mac Visual Studio Code. You can use the partial keyword ( Partial in Visual Basic) to divide the declaration of a class or structure among several declarations. You can use as many partial declarations as you want. The declarations can be in one or in multiple source files.

How do I add a partial class?

Open Visual Studio from "Start" -> "All programs" -> "Microsoft Visual Studio". Then, go to "File" -> "New" -> "Project..." then select "Visual C#" -> "Windows" -> "Console application". Then, specify the name such as Partial class or whatever name you wish and the location of the project and click on the "OK" button.

What is partial in C#?

The partial keyword indicates that other parts of the class, struct, or interface can be defined in the namespace. All the parts must use the partial keyword. All the parts must be available at compile time to form the final type. All the parts must have the same accessibility, such as public , private , and so on.

What is partial class in VB net?

Visual Basic uses partial-class definitions to separate generated code from user-authored code in separate source files. For example, the Windows Form Designer defines partial classes for controls such as Form. You should not modify the generated code in these controls.


1 Answers

If you open the context menu on the class name and click "Go To Definition (F12)", then the panel "Find Symbol Results" will show at the bottom (by default) of Visual Studio. Here you'll find all (partial) definitions of that class.

partial class

like image 51
CodeCaster Avatar answered Sep 23 '22 10:09

CodeCaster