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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Code File Structure ❘ 41<br />

}<br />

namespace OrderEntry<br />

{<br />

public class OrderEntryClerk<br />

{<br />

...<br />

}<br />

}<br />

}<br />

...<br />

If a file includes a using directive to indicate that it is using a namespace, it does not need to explicitly<br />

identify the namespace to use the classes and other items it defines. You only need to explicitly use the<br />

namespace if multiple included namespaces define items with the same name.<br />

All program elements in a <strong>C#</strong> program must be inside a namespace. By default, any code files you<br />

create include a namespace named after the project you initially created. For example, if you create<br />

an application named OrderEntrySystem, by default its code is contained in the OrderEntrySystem<br />

namespace.<br />

You can view and modify the project’s default namespace by selecting Project ➪ Properties and looking<br />

on the Application tab. Figure 3-7 shows the Application tab for the WindowsFormsApplication1<br />

project. The default namespace is WindowsFormsApplication1.<br />

Figure 3-7: A project’s property pages let you view and change the project’s<br />

default namespace.<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!