Quickly learn to program in C# programming with this unique book and video package C# 24-Hour Trainer, 2nd Edition is your quick and easy guide to programming in C#, even if you have no programming experience at all. Updated to align with the latest C# standard, this book is your comprehensive beginner's guide, with each lesson supplemented by a video, for over ten hours of video training. Each chapter focuses on a specific concept or technique, with detailed, easy-to-follow explanation followed by a hands-on exercise. The goals of each exercise are outlined in advance to help you understand what you're working toward, and step-by-step instructions walk you through the operation from start to finish. Complex areas are clarified with specifically highlighted pointers that head off confusion, and additional exercises are provided so you can practice your new skills. Full instructor ancillaries are included to make this guide classroom ready, and the author's own website offers ongoing support.
C# has become one of the most popular programming languages in the world, with millions of lines of code used in businesses and applications of all types and sizes. This book helps you dive right in so you can start programming right away.
Start right in with the latest C# standard Learn at your own pace, with hands-on practice Clear up confusion and work around common obstacles Build your own Windows, .NET, and mobile applications C# has become a increasingly popular and in-demand programming skillsets. If you've decided to learn C#, this 24-Hour Trainer is your ultimate guide.
Author(s): Rod Stephens
Edition: 2
Publisher: Wrox Press
Year: 2015
Language: English
Pages: 600
Cover
Title Page
Copyright
Contents
Introduction
Section I: The Visual Studio IDE and Controls
Lesson 1: Getting Started with the Visual Studio IDE
Installing C#
Configuring the IDE
Building Your First Program
Copying Projects
Exploring the IDE
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 2: Creating Controls
Understanding Controls
Properties
Methods
Events
Creating Controls
Setting Control Properties
Control Names
Popular Properties
Modifying Properties in Code
Arranging Controls
Snap Lines
Arrow Keys
The Format Menu and Layout Toolbar
WPF Controls
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 3: Making Controls Arrange Themselves
Restricting Form Size
Using Anchor Properties
Using Dock Properties
Layout Containers
Windows Forms Controls
WPF Controls
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 4: Handling Events
Making Event Handlers
Using Event Parameters
Setting Scrollbar Properties
Tracking Mouse Movement
Moving the Mouse Picture
Removing Event Handlers
Adding and Removing Event Handlers in Code
Useful Events
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 5: Making Menus
Creating Menus
Setting Menu Properties
Handling Menu Events
Creating Context Menus
WPF Menus
WPF Context Menus
WPF Commanding
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 6: Making Tool Strips and Status Strips
Using Tool Strips
Using Tool Strip Containers
Using Status Strips
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 7: Using RichTextBoxes
Using RichTextBox Properties
Giving the User Control
Using RichTextBox Methods
Using WPF Commands
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 8: Using Standard Dialogs
Using Dialogs in General
Adding the Dialog to the Form
Initializing the Dialog
Displaying the Dialog and Checking the Return Result
Processing the Results
Putting It All Together
Using Dialog Properties
Using File Filters
Using Dialogs in WPF
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 9: Creating and Displaying New Forms
Adding New Forms
Understanding Classes and Instances
Displaying Forms
Controlling Remote Forms
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 10: Building Custom Dialogs
Making Custom Dialogs
Setting the Dialog Result
Using Custom Dialogs
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Section II: Variables and Calculations
Lesson 11: Using Variables and Performing Calculations
What Are Variables?
Data Types
Float, Double, and Decimal Data Types
Declaring Variables
Literal Values
Type Conversions
Casting
Converting
Parsing
Performing Calculations
Operands and Operators
Promotion
Operator Summary
Precedence
Constants
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 12: Debugging Code
Deferred Techniques
Debugging Then and Now
Setting Breakpoints
Reading Variables
Stepping through Code
Using Watches
Using the Immediate Window
Try It
Lesson Requirements
Step-by-Step
Exercises
Lesson 13: Understanding Scope
Scope within a Class
Same Named Variables
Method Variable Lifetime
Block Scope
Accessibility
Restricting Scope and Accessibility
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 14: Working with Strings
String Methods
Format and ToString
Standard Numeric Formats
Custom Numeric Formats
Standard Date and Time Formats
Custom Date and Time Formats
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 15: Working with Dates and Times
Creating DateTime Variables
Local and UTC Time
DateTime Properties and Methods
TimeSpans
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 16: Using Arrays and Collections
Arrays
Creating Arrays
A Fibonacci Example
Multi-Dimensional Arrays
Array Properties and Methods
Collection Classes
Generic Classes
Lists
SortedLists
Dictionaries
Queues
Stacks
Try It
Lesson Requirements
Step-by-Step
Exercises
Lesson 17: Using Enumerations and Structures
Enumerations
Structures
Structures versus Classes
Reference Types
Value Types
Other Differences
Where to Put Structures
Try It
Lesson Requirements
Step-by-Step
Exercises
Section III: Program Statements
Lesson 18: Making Choices
Decision Statements
if Statements
if-else Statements
Cascading if Statements
Nested if Statements
switch Statements
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 19: Repeating Program Steps
for Loops
foreach Loops
while Loops
do Loops
break and continue
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 20: Reusing Code with Methods
Method Advantages
Method Syntax
Using ref Parameters
Using out Parameters
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 21: Handling Errors
Errors and Exceptions
try-catch Blocks
TryParse
Throwing Exceptions
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 22: Preventing Bugs
Input Assertions
Other Assertions
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Section IV: Classes
Lesson 23: Defining Classes
What Is a Class?
Class Benefits
Making a Class
Properties
Try It
Lesson Requirements
Step-by-Step
Methods
Events
Delegates
Event Handler Delegates
Try It
Lesson Requirements
Hints
Step-by-Step
Inheritance
Polymorphism
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 24: Initializing Objects
Initializing Objects
Constructors
Parameterless Constructors
Parameterized Constructors
Destructors
Invoking Other Constructors
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 25: Fine-Tuning Classes
Overloading Methods
Overriding Methods
Overriding ToString
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 26: Overloading Operators
Overloadable Operators
Unary Operators
Binary Operators
Comparison Operators
Conversion Operators
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 27: Using Interfaces
Interface Advantages
Multiple Inheritance
Code Generalization
Implementing Interfaces
Defining Interfaces
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 28: Making Generic Classes
Defining Generic Classes
Using Generic Constraints
Making Generic Methods
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Section V: System Interactions
Lesson 29: Using Files
Filesystem Classes
DriveInfo
DirectoryInfo
Directory
FileInfo
File
Path
Streams
Writing Files
Reading Files
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 30: Printing
Windows Forms Printing
Getting Started
Starting a Printout
Drawing Shapes
Drawing Text
WPF Printing
Printing Visuals
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Section VI: Windows Apps
Lesson 31: Windows Store Apps
Navigation Style
App Styles
App Images
Deployment
Deploying Locally
Deploying to the Windows Store
WPF Techniques
Using Styles
Setting Dependency Properties
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 32: Windows Phone Apps
Building Apps
Navigation Style
App Styles
App Images
Try It
Lesson Requirements
Step-by-Step
Exercises
Section VII: Specialized Topics
Lesson 33: Localizing Programs
Understanding Localization
Building Localized Interfaces
Testing Localizations
Processing Locale-Specific Values
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 34: Programming Databases, Part 1
Connecting to a Database
Displaying Data in a Grid
Displaying Data One Record at a Time
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 35: Programming Databases, Part 2
Searching
Filtering
Sorting
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 36: LINQ to Objects
LINQ Basics
where Clauses
order by Clauses
select Clauses
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Lesson 37: LINQ to SQL
Connecting to the Database
Making LINQ to SQL Classes
Writing Code
Using LINQ Queries
Understanding Nullable Fields
Understanding Query Execution
Using LINQ to SQL with Access
Try It
Lesson Requirements
Hints
Step-by-Step
Exercises
Afterword: What’s Next?
Index
EULA