Skip to Content
Visual Basic 2015 Unleashed
book

Visual Basic 2015 Unleashed

by Alessandro Del Sole
July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Sams
Content preview from Visual Basic 2015 Unleashed

Creating Types with Generate from Usage

One great feature in the code editor that Visual Studio 2015 inherits from its predecessors is the ability to generate on-the-fly objects that do not exist yet. This feature is known as Generate from Usage, and now it is integrated within light bulbs and quick actions, described in Chapter 6, “Errors, Exceptions, and Code Refactoring.” To understand how it works, create a new Console application named GenerateFromUsage and, within the Main method, type the following code:

Sub Main()    Dim p As New PersonEnd Sub

Because the Person class has not been implemented, the Visual Basic compiler throws an exception, but if you enable the light bulb, it will suggest possible solutions, as shown in Figure 17.11 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Visual Basic 2015

Beginning Visual Basic 2015

Bryan Newsome

Publisher Resources

ISBN: 9780134196664Purchase book