Lesson 16: Using Attributes

This lesson explains how to use C# attributes. Our objectives are as follows: Understand what attributes are and why they’re used Apply various attributes with multiple or no parameters Use assembly, type member, and type level attributes Why Attributes? Attributes are elements that allow you to add declarative information to your programs. This declarative information … Continue reading “Lesson 16: Using Attributes”

Lesson 15: Introduction to Exception Handling

This lesson teaches how to handle exceptions in your C# programs. Our objectives are as follows: Learn what an exception is Implement a routine with a try/catch block Release resources in a finally block Exceptions Exceptions are unforeseen errors that happen in your programs. Most of the time, you can, and should, detect and handle … Continue reading “Lesson 15: Introduction to Exception Handling”

Lesson 14: Introduction to Delegates and Events

This lesson introduces delegates and events. Our objectives are as follows: Understand What a Delegate Is Understand What an Event Is Implement Delegates Fire Events Delegates During previous lessons, you learned how to implement reference types using language constructs such as classes and interfaces. These reference types allowed you to create instances of objects and … Continue reading “Lesson 14: Introduction to Delegates and Events”

Lesson 13: Interfaces

This lesson teaches C# Interfaces. Our objectives are as follows: Understand the Purpose of Interfaces. Define an Interface. Use an Interface. Implement Interface Inheritance. An interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methods and/orproperties. The reason interfaces only provide declarations is because they … Continue reading “Lesson 13: Interfaces”