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.

INTRODUCTION<br />

Who Should Read This Book<br />

This book is intended for intermediate and advanced programmers who have already programmed<br />

in <strong>C#</strong> or some other language. This book describes <strong>C#</strong> in detail but it does so quickly and assumes<br />

you already understand basic programming concepts. If you’re a beginner, you can still use this<br />

book to learn to program in <strong>C#</strong>, but it will be a bit harder. If you get stuck, feel free to e-mail me<br />

at RodStephens@CSharpHelper.com and I’ll try to put you back on the right track.<br />

One of the main reasons this book assumes you know programming basics is it’s hard to find a<br />

simple order in which to present topics in depth. For example, declaring and using variables is one<br />

of the most basic concepts in programming. (This book covers that early in Chapter 4, “Data Types,<br />

Variables, and Constants.”) However, in <strong>C#</strong> variable declarations are different depending on whether<br />

they are inside a class’s method. (In some languages methods are also called procedures, subprocedures,<br />

routines, subroutines, or functions.) If you already know what a method is, then the book<br />

can cover variables in depth. If you are unfamiliar with methods, a book can present only the basics<br />

of variable declarations, then cover classes, and finally return to the topic of variables. This book<br />

assumes you know basics such as what a variable is and what methods are, so it can quickly move<br />

through topics without a lot of repeating and backtracking.<br />

If fundamentals such as variable declarations, data types, classes, and arrays are familiar to you, you<br />

should have no problem with this book. The index and reference appendices should be particularly<br />

useful in helping you remember the syntax for performing various <strong>C#</strong> tasks such as creating a class or<br />

making a generic method.<br />

If you don’t know what data types are, what a for loop is, and what an if statement does, you<br />

can probably pick those things up as you go along, but you may need to go back and reread a few<br />

chapters after you get the hang of things.<br />

Approach<br />

A program can interact with the user in many ways. It can read and write text in a console window.<br />

It can use Windows Forms and controls to provide a more graphical interface. A program can use<br />

Windows Presentation Foundation (WPF) controls to build an interface that is even more richly<br />

graphical and interactive than Windows Forms interfaces. Recently, a Windows Store program can<br />

use controls similar to those used in a WPF application to run in the Windows 8 operating system.<br />

Some programs provide no interface for the user and instead provide tools and services for other<br />

programs to use behind the scenes.<br />

Building applications that use these different approaches takes a lot of work. The steps you take to<br />

build a WPF application are different from those you use to build a console application. However,<br />

no matter which kind of application you build, behind the user interface sits a bunch of good old<br />

<strong>C#</strong> code. You use the same syntax to create classes, loops, methods, and variables whether you’re<br />

building Windows Forms applications or WPF applications. The same <strong>C#</strong> language enables you<br />

to build applications to run in a console window, on the Windows desktop, in Windows 8, in a<br />

browser, or even in Windows Phone.<br />

xxxiv<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!