CSE681 - Software Modeling & Analysis

Lecture #5 - The C# Programming Language

Example Code

This lecture continues our introduction to the C# programming language. We will focus on code examples.

Web Resources:

UML XML, HTML Code Project Microsoft Developer's Network DevelopMentor XML Sells Brothers Windows Developer's Journal WindowsClient.net DotNetJunkies dotnet quickstart tutorials C# Corner Mono Project Performance Counters

Specifics:

  1. The Syllabus describes topics to be covered, reading material for you to digest before coming to class, and due dates for the assigned projects.
  2. Projects:

  3. .Net Framework Class Libraries

  4. Code Examples:

    C# Demos
    Illustrates basic classes, class relationships, generics, enumerables, and extension methods.

    C# Syntax Examples
    Demonstrates use of arrays, properties, indexers, simple reflection, and disposing.

    Passing value and refence types by value and ref, Parameter Passing
    These four cases all have different semantics.

    Demo Command Line and File Handling
    Using command line arguments to find and open files.

    Collectons Demo
    Simple tokenizing demonstration as part of a HashTable test.

    .Net containers
    Use of ArrayList, List<T>, LinkedList, SortedList, HashTable, HashSet<T>, Queue<T>, Stack<T>

    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.

    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. Programming in C#
  6. Using Dynamic Link Libraries (DLLs)
    Shows how to build and execute dynamic link libraries - make sure you study both the code and comments in this demonstration.
  7. C# Code Examples and Tutorials:

  8. Lecture Take-away:

    The most important things we discussed today are: