Download presentation
Presentation is loading. Please wait.
Published byTrevor Davis Modified over 9 years ago
1
1 INF160 IS Development Environments AUBG, COS dept Lecture 06 Title: Dev Env: Visual Studio (Extract from Syllabus) Reference: www.microsoft.com/visualstudio
2
2 Lecture Contents: §Visual Studio – introduction §Visual Studio – functionality §Visual Studio – configuration
3
3 MS Visual Studio – introduction §Microsoft Visual Studio is used to develop l console and graphical user interface applications, l Windows Forms applications, l web sites, l web applications, and l web services in both native code together with managed code for all platforms supported by Microsoft Windows, including Windows Mobile, Windows CE,.NET Framework,.NET Compact Framework and Microsoft Silverlight
4
4 Visual Studio – functionality §Visual Studio includes: l A code editor supporting IntelliSense Code snippets and Code refactoring. l The integrated debugger works both as a source-level debugger and as a machine-level debugger. l Forms designer for building GUI applications, l Class designer, l And other SW tools
5
5 Visual Studio – functionality §Visual Studio supports a variety of Programming languages. §Built-in languages include l C/C++ (via Visual C++), l VB.NET (via Visual Basic.NET), l Visual C# l Visual F# l Support for other languages such as M, Python, and Ruby among others is available via language services installed separately. It also supports XML/XSLT, HTML/XHTML, JavaScript and CSS.
6
6 MS Visual Studio §How to Use & Configure?
7
7 MS Visual Studio How to Use & Configure §To start MS Visual Studio §Detailed information available in file CppAppD2010 Using Project Folders.pdf, page 1.
8
8 MS Visual Studio How to Use & Configure §Important note: To select a different window layout, §click Tools on the menu bar, click Import and Export Settings, select the Reset all settings radio button and then click the Next button. §Select the appropriate radio button in the Save Current Settings pane, click the Next button. §Click the preferred collection of settings (such as Visual C++ Development Settings), and then click the Finish button. §Click the Close button (.pdf, page 2).
9
9 MS Visual Studio How to Use & Configure §Setting the Appropriate Options l To set the appropriate options: (.pdf, page 3) l Tools > Options > Projects and Solutions
10
10 MS Visual Studio How to Use & Configure §Managing the variety of windows in the IDE §Usually, you will find it easier to work in the IDE if you either close or auto-hide the windows you are not currently using. §The easiest way to close an open window is to click the Close button on the window’s title bar. In most cases, the View menu provides an appropriate option for opening a closed window (.pdf, page 4).
11
11 MS Visual Studio How to Use & Configure §Managing the variety of windows in the IDE §Rather than closing a window, you also can auto-hide it. You auto-hide a window using the Auto Hide button (shown earlier in Figures D1 and D2) on the window’s title bar. The Auto Hide button is a toggle button: clicking it once activates it, and clicking it again deactivates it (.pdf, page 4).
12
12 MS Visual Studio How to Use & Configure §Creating a Console Application (.pdf, page 5) l Solution, Project, File l Drawer analogy: Figure D-4 l Illustration of a solution, project, and file l Drawer-Solution l Folder-Project l Document-File
13
13 MS Visual Studio How to Use & Configure §To create a C++ console application: §(.pdf, pages 6-8)
14
14 MS Visual Studio How to Use & Configure §Adding a New Source File to an Open Project §To add a new source file to an open project: (.pdf, page 9)
15
15 MS Visual Studio How to Use & Configure §Adding an Existing Source File to a Project §To add an existing source file to an open project: (.pdf, page 10)
16
16 MS Visual Studio How to Use & Configure §Entering C++ Program Instructions: §(.pdf, page 10)
17
17 MS Visual Studio How to Use & Configure §Running a C++ Program: (.pdf, page 12)
18
18 MS Visual Studio How to Use & Configure §Important Note: You can change the color of the Command Prompt window’s background and text to make the display clearer. §Right-click the Command Prompt window’s title bar and then click Properties. l Click the Colors tab. l Select the Screen Text radio button and then click the black square. l Select the Screen Background radio button and then click either the light gray square or the white square (.pdf, page 13)
19
19 MS Visual Studio How to Use & Configure §Important Note:. §You also can change the font used to display the text in the Command Prompt window. §Click the Font tab. Click Lucida Console in the list of fonts and then select the Bold fonts check box. Click 20 in the Size list box and then click the OK button. See Figure D-14: (.pdf, page 13)
20
20 MS Visual Studio How to Use & Configure §Important Note:. §You also can change the font size used to display the text in the Text Editor window. Click the bottom left corner of the Code Editor window, zoom combo box gets opened, you are free to select or to type preferred zoom percentage in the range 20%...400%.
21
21 MS Visual Studio How to Use & Configure §Displaying Line Numbers in the Editor Window (.pdf, page 14) §Tools >Options >Text Editor >All Languages >General
22
22 MS Visual Studio How to Use & Configure §Debugging a C++ program. (.pdf, page 15) §Tools > Options > Debugging
23
23 MS Visual Studio How to Use & Configure §Printing a C++ program (.pdf, page 17). §File > Page Setup … §File > Print …
24
24 MS Visual Studio How to Use & Configure §Closing the current solution (.pdf, page 18) §File > Close Solution
25
25 MS Visual Studio How to Use & Configure §Opening an existing solution. (.pdf, page 18) §From within IDE: l File > Open > Project/Solution… §From Windows Explorer: l Open project folder l Click file with extension.sln
26
26 MS Visual Studio §How to Configure?
27
27 Visual Studio – configuration B.Doyle, C#, App A, p993-1005 Extract
28
28 Customizing the IDE §Default Start page
29
29 Using menu: Tools > Options §15 folders opened
30
30 Using menu: Tools > Options §folder node: Environment, General
31
31 Using menu: Tools > Options §folder node: Environment, Fonts and Colors
32
32 Using menu: Tools > Options §folder node: Environment, Import&Export Settings
33
33 Using menu: Tools > Options §folder node: Environment, Startup
34
34 Using menu: Tools > Options §folder node: Projects and Solutions, General
35
35 Using menu: Tools > Options §folder node: Projects and Solutions, General
36
36 Using menu: Tools > Options §folder node: Projects and Solutions, Build & Run
37
37 Using menu: Tools > Options §folder node: Text Editor,
38
38 Using menu: Tools > Options §folder node: Text Editor,
39
39 Using menu: Tools > Options §folder node: Text Editor, All Languages, Tabs
40
40 Using menu: Tools > Options §folder node: Text Editor, C#, Intellisense §IntelliSense is Microsoft's implementation of autocompletion. §In addition to completing the symbol names the programmer is typing, IntelliSense serves as documentation and disambiguation for variable names, functions and methods using reflection §Autocomplete involves the program predicting a word or phrase that the user wants to type in without the user actually typing it in completely
41
41 Using menu: Tools > Options §folder node: Text Editor, C#, Intellisense
42
42 Using menu: Tools > Options §folder node: Debugging
43
43 Using menu: Tools > Options §folder node: HTML Designer
44
44 Using menu: Tools > Options §folder node: Windows Forms Designer
45
45 Using menu: Tools > Customize §You can select which toolbars are displayed in the IDE §You can also specify which commands are to be included within each toolbar.
46
46 Using menu: Tools > Customize.
47
47 Using menu: Tools > Customize §Tab Toolbars
48
48 Using menu: Tools > Customize §Tab Commands
49
49 Code Editor Tools B.Doyle, C#, App B, pp 1007-1017 §Extract
50
50 Code Editor Tools §Code Snippets
51
51 Code Editor Tools §Code snippets are templates that you can use to insert code. §Built-in snippets are stored as XML files and grouped in categories: l ASP.NET MVC l OFFICE DEVELOPMENT l OTHER l TEST l VISUAL C#
52
52 Code Editor Tools §Code Snippets are ACTIVATED: l By Typing snippet alias and pressing TAB key Or l By Pressing CTRL+K+X to activate the code snippet list and selecting the desired snippet alias Or l By Pressing CTRL+’SpaceBar’ to display more exhaustive list of snippets
53
53 Exercise on Code Snippets §Type two loop statement level control structures using l Code snippet for l Code snippet forr
54
54 Exercise on Code Snippets §Test two more code snippets l Code snippet class l Code snippet ctor
55
55 Code Editor Tools §Refactoring §Code refactoring is "disciplined technique for restructuring an existing body of source code, altering its internal structure without changing its external behaviour”. §How to activate: Edit > Refactor …
56
56 Code Editor Tools §Refactoring: Extract method §How to activate: §Edit > Refactor > Extract Method…
57
57 Code Editor Tools §Refactoring: Rename §How to activate: §Edit > Refactor > Rename…
58
58 Code Editor Tools §Refactoring l Other options
59
59 Exercise on Refactoring §Test the Rename… option l Type source text in C# l Select a variable name l Activate the Rename… option
60
60 Exercise on Refactoring §Test the Extract method… option l Type source text in C# l Select a statement or a group of statements l Activate the Extract method… option l Sample source texts Text1: c= a+b; what method return type is expected? Text2: { c= a+b; Console.WriteLine(”c=“+c); } What method return type is expected? Text3: type spaghetti code for factorial, GCD, Fibonacci and refactor it to separate methods.
61
61 Code Editor Tools §Working with Class Diagrams §Right clicking on the project in Solution Explorer opens list of options §Select View Class Diagram
62
62 Code Editor Tools §Working with Class Diagrams l Class Details View
63
63 Code Editor Tools §Working with Class Diagrams l Using the Class Diagram to Add Members l How? l Right clicking on any of the classes in the class diagram reveals options to add additional methods, properties, fields, or events.
64
64 Using the IDE Editor Farrell C#, AppC, pp775-778 §C# support categories: §IntelliSense §Code Snippets §Wavy Underlines §Readability Aids
65
65 Using the IDE Editor Farrell C#, AppC, pp775-778 §C# support categories: §IntelliSense
66
66 Using the IDE Editor Farrell C#, AppC, pp775-778 §C# support categories: § §Code Snippets
67
67 Using the IDE Editor Farrell C#, AppC, pp775-778 §C# support categories: §Wavy Underlines §Wavy Underlines give you instant feedback about errors in your code as you type l Red wavy underline signals a severe syntax error l Green wavy underline signals a compiler warning.
68
68 Using the IDE Editor Farrell C#, AppC, pp775-778 §C# support categories: §Readability Aids §The editor assigns different colors to various categories of identifiers in C# to make the code easier to read
69
69 Thank You For Your Attention!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.