#region  --------------- Copyright Dresser Wayne Pignone -------------
/*
 * $Log: /Wrk/WayneLibraries/Wrk/StateEngine/TransitionInfo.cs $
 * 
 * 2     08-03-10 16:16 Mattias.larsson
 * Fixed summaries.
 * 
 * 1     08-03-10 15:00 Mattias.larsson
 * Created.
 */
#endregion

using System;
namespace Wayne.Lib.StateEngine
{
    /// <summary>
    /// A class wrapping information about a transition.
    /// </summary>
    public class TransitionInfo
    {
        #region Fields

        private string fromStateFactoryName;
        private string transitionName;
        private string toStateFactoryName;
        private HistoryType historyType;

        #endregion

        #region Construction

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="fromStateFactoryName"></param>
        /// <param name="transitionName"></param>
        /// <param name="toStateFactoryName"></param>
        /// <param name="historyType"></param>
        public TransitionInfo(string fromStateFactoryName, string transitionName, 
            string toStateFactoryName, HistoryType historyType)
        {
            this.fromStateFactoryName = fromStateFactoryName;
            this.transitionName = transitionName;
            this.toStateFactoryName = toStateFactoryName;
            this.historyType = historyType;
        }

        #endregion

        #region Properties

        /// <summary>
        /// The factory name of the "From" state.
        /// </summary>
        public string FromStateFactoryName
        {
            get { return fromStateFactoryName; }
        }

        /// <summary>
        /// The name of the transition.
        /// </summary>
        public string TransitionName
        {
            get { return transitionName; }
        }

        /// <summary>
        /// The factory name of the "To" state.
        /// </summary>
        public string ToStateFactoryName
        {
            get { return toStateFactoryName; }
        }

        /// <summary>
        /// The History Type.
        /// </summary>
        public HistoryType HistoryType
        {
            get { return historyType; }
        }

        #endregion

        #region Methods

        /// <summary>
        /// To string.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Format("{0} >>{1}>> {2}", fromStateFactoryName, transitionName, toStateFactoryName);
        }

        #endregion
    }
}