#region --------------- Copyright Dresser Wayne Pignone -------------
/*
* $Log: /Wrk/WayneLibraries/Wrk/StateEngine/Generic/CompositeState.cs $
*
* 6 08-05-07 15:35 roger.månsson
* Obsoleted constructor with main object reference again. Instead, use
* WritableMain property. When this is set on a composite state object,
* the abstract method "ConfigureCompositeStateMachine" is called, and the
* configuration of the state machine can be made.
*
* 5 08-04-25 9:02 Mattias.larsson
* Obsoleted the WritableMain-usage. A state-constructor taking the
* Main-object as an argument should be used.
*
* 4 08-04-24 15:45 Mattias.larsson
*
* 3 08-02-26 14:12 Mattias.larsson
* Removed Obsolete methods.
*
* 2 07-03-12 15:17 roger.månsson
* Documentation update.
*
* 1 07-03-02 13:20 roger.mnsson
* Created generic reusable state classes that has a main object.
*/
#endregion
namespace Wayne.Lib.StateEngine.Generic
{
///
/// Generic composite state class that has a main object of a generic type.
///
/// Specifies the type of the main object.
public abstract class CompositeState : Wayne.Lib.StateEngine.CompositeState, IGenericState
{
#region Properties
///
/// The main object.
///
protected TMain Main
{
get;
private set;
}
#endregion
#region Methods
///
/// Configure the composite state machine
///
protected abstract void ConfigureCompositeStateMachine();
#endregion
#region IGenericState Members
TMain IGenericState.WritableMain
{
get { return Main; }
set
{
Main = value;
//Configure the state machine after the writable main has been assigned.
ConfigureCompositeStateMachine();
}
}
#endregion
}
}