Programming with C#
Course Outline

DURATION 2 Days
PREREQUISITES Previous experience of programming, particularly in an object oriented language, would be useful but not essential.
DESCRIPTION This class is an introduction to the C# ("C sharp") programming language. It will cover the concepts and building blocks of the C# programming language, such as how .NET is different from traditional programming, defining variables, control structures, operators, classes and methods. It will provide delegates with a skill base from which they can go on to develop C# applications on either the Windows Forms or ASP.NET platforms.
COURSE DATES Click here to request an alternate date
Or call us on 020 313 73958 from 8:00 to 22:00 Monday to Sunday.

Weekday Mon, 6-Dec-10 and Tue, 7-Dec-10 09:30 - 16:30 £495

 

 

Introduction to .NET

  • What is .NET?

  • .NET Building Blocks

  • Common Language Runtime

  • Framework Class Library

  • Base Class Library (or

  • Common Type System (CTS)

  • Common Language System

Introduction to C#

  • What is C# ?

  • What is C# used for?

  • Features of C#

  • What does C# look like?

  • Visual C# IDE

Getting started

  • Creating a project

  • The Main method

  • C# basics

  • Displaying the User

  • Adding comments

  • Compiling and running the program from the command line

  • Compiling and running the program using the Visual C# IDE

Variables

  • Variables in C#

  • Declaring variables

  • Variable name rules

  • C# keywords

  • Assigning a value to a variable

  • Strings

  • Example: A String variable

  • Escape Sequences

  • Verbatim string

  • Character data types

  • Numeric data types

  • Signed and Unsigned

  • Byte

  • Signed Byte

  • Short Integers

  • Unsigned Short Integers

  • Signed Integers

  • Unsigned Integers

  • Long Integers

  • Unsigned Long Integers

  • Real Numbers: float

  • Double-Precision Numbers

  • Decimal

  • The Boolean Data Type

  • The DateTime Data Type

  • Assigning a DateTime value

  • Declaring a variable

  • Constants

  • C# / .NET Data Types

  • C# / .NET Data Type equivalents

  • Example: Data type conversion

Data type conversion, properties and methods

  • Example: data type properties

  • Example: data type methods

  • String immutability

  • String.Format

  • String.Format

  • Example: String.Format

  • Numeric formatting in String.Format

  • Common Format Specifiers

  • Console.WriteLine equivolents

  • String methods: PadLeft and PadRight

  • String method: Substring

  • More String methods

  • DateTime properties

  • DateTime properties

  • Static DateTime properties

  • DateTime methods

  • Examples: DateTime methods

  • Converting DateTime to a String

  • DateTime format masks

  • Converting numeric data to string

  • Implicit and explicit conversion

  • Using Parse to convert data types

  • Using TryParse to convert data types

  • System.Convert

  • Examples: System.Convert

Operators

  • C# operators

  • The + operator

  • The -, * and / operators

  • The ++ increment assignment operator

  • Examples: The ++ increment assignment operator

  • The -- decrement assignment operator

  • The += addition assignment operator

  • The -=, *= and /= operators

  • Logical operators ==

  • Logical operators !=

  • Logical operators < and >

  • Logical operators <= and >=

  • Logical ‘and’ Conjunction: &

  • Conditional ‘and’ Conjunction: &&

  • The Binary ‘or’ operator: |

  • The Conditional OR operator: ||

  • The exclusive ‘or’ operator: ^

Conditional logic

  • Conditional control: if

  • Example: if

  • Conditional control: else

  • Example: if/else

  • if .. else if

  • if .. else if

  • Example: if .. else if

  • The Ternary Operator: ? :

  • Example

  • The Ternary Operator

  • Case Switches Syntax

  • Case Switches Example

  • Case Switch

  • Branching statements

  • goto

  • Example: goto

Loops

  • Loops

  • The while loop

  • Example: a while loop

  • do…while

  • Example: a do...while loop

  • The for loop

  • The for loop syntax

  • Example: for loop

  • Breaking out of a loop

  • Example: breaking out of a loop

  • Continuing a loop

  • Example: Continuing a loop

Methods

  • Methods of a class

  • Example: Defining and

  • Types of method

  • Method parameters

  • Declaring a method

  • Examples: Method declarations

  • Specifying method parameters

  • Returning a value from a method

  • Example: a complete method

  • Overloading a method

  • Example: overloading a method

Introduction to Classes

  • Object oriented programming

  • Classes

  • Objects

  • Creating a class

  • Creating a class in its own file

  • Creating an object

  • Assigning a value to an object

  • Accessing class members

  • Reference variables

  • Example: Reference types

  • Class Fields

  • Access modifiers

  • The public access modifier

  • The private access modifier

Properties

  • Encapsulation

  • Example: traditional encapsulation

  • Properties

  • Coding a Property

  • Implementing a Property

  • Example: A simple

  • Example: A property with accessor logic

  • Accessing a property

  • Read only Properties

  • Write only Properties

  • New in C# 3.0: Automatic Properties

  • Example: Automatic properties in C# 3.0

  • Read only / Write only Automatic Properties

  • Initializing Automatic Properties

Constructors

  • What are constructors?

  • Example: a constructor

  • Constructors with arguments

  • Calling a constructor

  • The default constructor

  • Constructor chaining

  • Static constructors

  • Static constructor

  • Declaring a static constructor

  • Static constructor rules

Destructors

  • What are destructors?

  • Example: A destructor

  • Destructors and memory management

  • Destructor method rules

  • When to use destructors?

Inheritance

  • Introduction to Inheritance

  • Examples of inheritance use

  • Deriving one class from another

  • Example: Deriving one class from another

  • Adding to a Derived Class

  • Example: Adding to a Derived Class

  • Overriding Members of the Base Class

  • Example: Overriding Members of the Base Class

  • Calling Members of the Base Class

  • Referencing the constructor of an inherited class

  • Multi-Level Hierarchies

  • The protected access modifier

  • Constructors and Inheritance

  • Example: Constructors and Inheritance

  • Explicitly calling Base Class Constructors

  • Example: Explicitly calling Base Class Constructors

  • Protected Constructors

Static members and classes

  • Static Members of a class

  • Examples of static behaviour

  • Declaring Static Members

  • Referencing Static Members

  • Static Classes

  • Example: a static class

  • Rules of static classes

  • Static class constructors

  • Example: Static class constructors

Sealed and Abstract classes

  • Preventing inheritance from a class

  • Preventing the overriding of a member

  • Preventing instantiation from a class

  • Creating an abstract class

  • Members of an abstract class

  • Example: concrete and abstract properties

  • Example: concrete and abstract methods

Polymorphism and Name Hiding

  • Substituting a derived class for its parent

  • Polymorphism

  • Example: Polymorphism

  • Name hiding

  • Example: Name hiding

Boxing and Unboxing

  • Boxing and Unboxing

  • Boxing

  • Explicit Boxing

  • Unboxing

Arrays

  • Array Types

  • Declaring an Array

  • Initialising an array

  • Retrieving the length of an array

  • Using foreach to loop through an array

Interfaces

  • What is an interface?

  • Interface rules

  • Inheriting from an interface

  • Creating an interface

  • Properties of an interface

  • Methods in an interface

  • Basing a class on an interface

  • Basing an interface on an interface

  • Multiple inheritance

  • Example: Multiple inheritance

Delegates

  • What is a Delegate?

  • Creating a Delegate

  • Referencing a Method

  • Example: Using a delegate

  • Multicasting

  • Creating a Multicasting Delegate

  • Example: A Multicasting delegate

  • Scope

  • Removing Method References

  • Removing Method References - Multicasting

Structures

  • What is a structure?

  • Declaring a structure

  • Contents of a structure

  • Structure methods

  • Structure Variable Declaration

  • Uses of Structures

  • Example: Reference types

  • Example: Value types

  • Structure field values

  • Structure constructors

  • Structures and inheritance

Indexers

  • What are Indexers?

  • Syntax: Declaring an Indexer

  • Example: Class with an indexer

  • Using indexers

  • Overloaded Indexers

  • Example: class with overloaded indexers

Error handling

  • Introduction to Exception Handling

  • try .. catch

  • Example: try .. catch

  • finally

  • Example: try..catch..finally

  • The Exception Class

  • Catching the Exception instance

  • The Exception Message

  • Derived Exception Classes

  • FormatException

  • OverflowException

  • IndexOutOfRangeException

  • DivideByZeroException

  • Catching Multiple Exceptions

  • Example: Catching Multiple Exceptions

  • Exception Nesting

  • Example: Nested exceptions

  • Throwing an Exception

  • Example: Throwing an exception

  • Passing a message to the Exception class

  • Example: Throwing an exception, passing part of a message as an argument

  • Custom Exceptions

  • Defining Custom Exceptions

  • Example: Defining a Custom Exception

  • Throwing custom Exceptions

Enumerators

  • What are Enumerators?

  • When to use Enumerators?

  • Declaring enumerators

  • Example: An enumerator

  • Using the enumerator

Namespaces

  • What is a namespace?

  • Example: Namespace

  • Accessing Members of a Namespace

  • Namespace Nesting

  • Example: Namespace Nesting

  • using a Namespace

  • Example: using a Namespace

  • The System Namespace

 

 

 




Home | Contact | Terms and Conditions