123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #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
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Wayne.Lib.StateEngine.Generic
- {
- /// <summary>
- /// Generic composite state class that has a main object of a generic type.
- /// </summary>
- /// <typeparam name="TMain">Specifies the type of the main object.</typeparam>
- public abstract class CompositeState<TMain> : Wayne.Lib.StateEngine.CompositeState, IGenericState<TMain>
- {
- #region Properties
- /// <summary>
- /// The main object.
- /// </summary>
- protected TMain Main
- {
- get;
- private set;
- }
- #endregion
- #region Methods
- /// <summary>
- /// Configure the composite state machine
- /// </summary>
- protected abstract void ConfigureCompositeStateMachine();
- #endregion
- #region IGenericState<TMain> Members
- TMain IGenericState<TMain>.WritableMain
- {
- get { return Main; }
- set
- {
- Main = value;
- //Configure the state machine after the writable main has been assigned.
- ConfigureCompositeStateMachine();
- }
- }
- #endregion
- }
- }
|