
namespace CsvCount_ES
{
    /// <summary>
    ///    工作项的状态。
    /// </summary>
    public class WorkItemStateTypeless : IWorkItemStateTypeless
    {
        public WorkItem WorkItem { get; set; }

        /// <summary>
        ///    获取一个值，指示该实例是否完成。
        /// </summary>
        /// <value>
        ///     <c>true</c>  <c>false</c>.
        /// </value>
        public bool IsStopped => WorkItem.IsCompleted;

        /// <summary>
        ///    得到result属性.
        /// </summary>
        /// <value></value>
        public object Result => WorkItem.Result;

        /// <summary>
        ///    初始化类<see cref="WorkItemStateTypeless" /> 实例.
        /// </summary>
        /// <param name="workItem">工作单元</param>
        public WorkItemStateTypeless(WorkItem workItem)
        {
            WorkItem = workItem;
        }

        /// <summary>
        ///    释放
        /// </summary>
        public void Dispose()
        {
        }
    }
}