Runtime interpreted statechart with hierarchical (composite) and orthogonal (concurrent) states. Join and fork transitions. History. Source code in C#. Independent from threading, synchronization and timer runtime services. A state machine "template" precomputes time consuming runtime checks (like finding the LCA of transitions) and thus reduces the per-instance costs.
The state machine approach is a fairly common technique for controlling a system with complex behaviour.
Several free implementations are available in different languages with partly subtle differences, e.g.
Andreas Huber "The Boost Statechart Library" (http://www.boost.org/libs/statechart/doc/index.html)
Rainer Hessmer "qf4net: Quantum Framework for .Net" (http://www.hessmer.org/dev/qhsm/)
Leslie Sanford "A .NET State Machine Toolkit" (http://www.codeproject.com/script/Articles/Article.aspx?aid=11663)
Unfortunately the very thorough implementation from Boost is in C++ and I doubt it can be ported to C# due to its massive usage of C++ generic programming. Therefore other approaches and proposals are needed. This project provides one.
Using StaMa a state machine is defined in code by building a tree structure of states and transitions. States carry entry and exit actions as delegates, likewise transitions carry a delegate for the transition action. During excution the tree of states is traversed to find the transition triggered by a signal. Action delegates are executed traversing the tree of states.
Supplementary visual modelling and partial code generation from the visual model is provided through a Microsoft Visio script.