Week 3a - The C# Programming Language

Components and Introduction to C#

Synopsis:

This lecture provides an introduction to the C# programming language. We will cover the basic C# language, some of its unique features, and present several examples.

Readings and Activities for the Week:

Glossary of Terms

Lecture Content:

  1. The Syllabus describes topics to be covered, reading material for you to digest as part of each lecture, and due dates for assigned projects.
  2. Projects:

  3. Focus for this Lecture - C# Programming Language

  4. Code examples:

    • C# Demos
      Introduces classes, class relationships, generics, enumerable types, and extension methods.
      All of these are relevant to Project #2.
    • C# Syntax Examples
      Demonstrates use of arrays, properties, indexers, simple reflection, and disposing.
    • .Net containers, Code Snaps
      Use of ArrayList, List<T>, LinkedList, SortedList, HashTable, HashSet<T>, Queue<T>, Stack<T>
    • Delegate Structure, Delegates Demos
      Delegates support the publish/subscribe idiom and provide major support for .Net's event model.
    • Syntax for using Delegates, Code Snaps
      There are several alternate ways of using delegates. This demo explores them.
    • Lambda Capture, Code Snaps
      Lambdas are anonymous callable objects, often bound to delegates. They are used to define thread processing, and often as locally defined functionality that is application specific.
    • Navigate Directory Trees
      Shows how to walk through a directory tree, using the services of the Directory and Path classes from the Framework Class Library (FCL).
    • Navigate with Delegates
      Shows how to make the Navigate module reusable by incorporating delegates.
  5. Components:

  6. XML:

  7. Preparation for Synchronous Discussion:

    • Write a brief list of steps required to create a Visual Studio solution, add a project, and build.
    • Describe how to setup a Visual Studio Solution so that one package can use the services provided by another package.
  8. Lecture Take-away

    The most important things we discussed today are:
    • C# and .Net Framework presentations
    • C# demo code.
    Next time we will continue with more code examples. Please look at:
    Passing value and refence types by value and ref, Parameter Passing
    These four cases all have different semantics.

    Delegate Structure, Delegates Demos, Recent additions to C# - delegate shortcuts, lambdas, ...
    Delegates support the publish/subscribe idiom and provide major support for .Net's event model.