Examples for C#/.NET

The examples were developed and tested on various platforms such as MacOS X, Linux, and Windows 98 with the Cygwin tools. If possible, they should be compiled and tested with make.
Folder Subject
make/ Auxiliary files to adapt make for various platforms. Every makefile has at least the following targets:
all compile examples
clean remove generated files
test demonstrate examples
iis/ Copies of the Visual Studio Web Projects. The source and documentation files should be useful, the project files contain relative paths which may not work when an archive is unpacked elsewhere.
vs/ Copies of the Visual Studio Projects. The source and documentation files should be useful, the project files contain relative paths which may not work when an archive is unpacked elsewhere.
1 First Steps
hello/ example to check command line tool setup
Hello.cs Hello, World!
vs/Hello/ example to check Visual Studio setup
Test/Hello.cs Hello, World!
2 Object-Oriented Programming
conversions/ temperature conversion
first/ monolithic solution
DegF.cs convert from Celsius to Fahrenheit
makefile instructions
oop/ object-oriented solution
IConversion.cs what a conversion must do
LinearConversion.cs linear transformation
DegF.cs convert from Celsius to Fahrenheit
makefile instructions
3 Interoperation with J#
conversions/ temperature conversion
java/ extension: inverse conversion
IReversibleConversion.jsl how to invert a conversion
ReversibleLinearConversion.jsl inverse of linear transformation
DegC.jsl convert from Fahrenheit to Celsius
makefile instructions
4 Windows Forms
conversions/ temperature conversion
gui/ local graphical user interface
Gui.cs all-in-one
Gui.exe.config configuration file for probing
makefile instructions
5 Observers
observer/ simple demonstration
delegate.cs shows delegate
makefile instructions
6 Abstract Datatypes
adt/ general classes
IContainer.cs interface for simple containers
Test.cs methods for testing
makefile instructions for nmake
array/ implementations based on arrays
Container.cs fixed-size array
Abuse.cs scary overloads
Bag.cs dynamic array, multiple inserts
Set.cs dynamic array, unique identity inserts
equal.cs equality demo
EquivalenceSet.cs dynamic array, unique inserts
hash/ implementations based on hash tables
Container.cs base class, implements open hash
Bag.cs dynamic arrays, multiple inserts
Set.cs doubly linked lists, unique identity inserts
EquivalenceSet.cs binary trees, unique inserts
list/ implementations based on doubly-linked lists
Bag.cs multiple inserts
Set.cs unique identity inserts
EquivalenceSet.cs unique inserts
IApply.cs framework for function application
IVisitor.cs framework for visitor pattern
tree/ implementation based on sorted binary tree
Set.cs unique identity inserts
7 Threads
threads/ simple multi-threaded programs
many.cs several threads
randy.cs race condition
morse.cs attempt to synchronize critical region
any.cs consumer/producer with conditional critical region
semaphore.cs Dijkstra's semaphores
producer.cs consumer/producer based on semaphores
philosopher.cs dining philosopher problem
makefile instructions for nmake
8 Input/Output
io/ scanning text
grep.cs match a pattern in files
pipe.cs ring buffer as a stream
grepall.cs match several patterns
makefile instructions for nmake
9 Serialization
serialize/ object serialization
data.cs class to be serialized
out.cs create serialized ring of objects
in.cs deserialize ring of objects
proxy.cs proxy class to be deserialized
surrogate.cs surrogate framework for remote objects
inout.cs demo of surrogate framework
makefile instructions for nmake
10 Enum
enum/ trivial enum example
enum.cs display decoded flags
_