03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

28 ❘ CHAPTER 3 Program and Code File Structure<br />

Hidden Files<br />

Figure 3-1 shows the Solution Explorer window for a solution named<br />

TurtleSolution that contains two projects named TurtleLib and<br />

TurtleTest.<br />

Each project contains a Properties folder that represents the project’s<br />

properties. Each project also contains a <strong>Reference</strong>s item that represents<br />

references to libraries used by the project.<br />

In addition to the Properties and <strong>Reference</strong>s items, the projects contain<br />

files related to the project. In this example, the TurtleLib project<br />

includes the class definition file Turtle.cs, and the TurtleTest project<br />

contains the form definition file Form1.cs.<br />

In the TurtleTest project the Show All Files button has been clicked<br />

(the button third from the right at the top of the figure) so that you<br />

can see all the project’s files. The TurtleLib project has similar files,<br />

but they are hidden by default.<br />

These files are generated by Visual Studio for various purposes. For<br />

example, the bin and obj directories contain files generated when the<br />

projects are compiled.<br />

The following list describes the items contained in the TurtleTest<br />

project, as shown in Figure 3-1. The exact files you see for an application<br />

may be different from those shown here, but this list should give<br />

you an idea of what’s involved in building a project. Note that most<br />

of these files are generated automatically by Visual Studio, and you<br />

shouldn’t edit them manually. If you change them directly, you are<br />

likely to lose your changes when Visual Studio rebuilds them. You may<br />

even confuse Visual Studio so it can’t load the project.<br />

Figure 3-1: A solution<br />

contains one or more projects<br />

that contain files related to<br />

the project.<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

TurtleTest—This item represents the entire project. You can expand or collapse it to show<br />

and hide the project’s details.<br />

Properties—This item represents the project’s properties. To change the properties, either<br />

right-click this item and select Open or select Project ➪ Properties. Figure 3-2 shows the<br />

TurtleTest project’s properties pages.<br />

AssemblyInfo.cs—This file contains information about the project’s assembly. Instead of<br />

editing this file directly, select Project ➪ Properties to open the project’s properties page,<br />

and then on the Application tab, click the Assembly Information button. Figure 3-3 shows<br />

the TurtleTest project’s assembly information.<br />

Resources.Designer.cs—This file contains definitions of project resources such as strings and<br />

images. Instead of editing this file directly, select Project ➪ Properties to open the project’s<br />

properties page and then go to the Resources tab.<br />

Settings.Designer.cs—This file contains definitions of project settings. Instead of editing this<br />

file directly, select Project ➪ Properties to open the project’s properties page and then go to<br />

the Settings tab.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!