using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Edge.Core.Processor.Dispatcher
{
    public class OnProcessorsLifeCycleChangedEventArg
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="operationResults"></param>
        /// <param name="lifeCycleName"></param>
        /// <param name="reason">any descriptive info for help understand why this operation happened.</param>
        public OnProcessorsLifeCycleChangedEventArg(
            IEnumerable<ProcessorLifeCycleOperationResult> operationResults, string lifeCycleName, string reason)
        {
            this.OperationResults = operationResults;// operationResults.Select(r => ProcessorLifeCycleOperationResultDto.From(r));
            this.LifeCycleName = lifeCycleName;
            this.Reason = reason;
            this.TimeStamp = DateTime.Now;
        }

        public DateTime TimeStamp { get; set; }

        public string LifeCycleName { get; private set; }

        public string Reason { get; private set; }

        /// <summary>
        /// </summary>
        public IEnumerable<ProcessorLifeCycleOperationResult> OperationResults { get; private set; }
    }

    public class OnProcessorsInstantiatedEventArg : System.EventArgs
    {
        public OnProcessorsInstantiatedEventArg(
            IEnumerable<ProcessorInstanceOperatingResult> operationResults)
        {
            this.OperationResults = operationResults;
        }

        public IEnumerable<ProcessorInstanceOperatingResult> OperationResults { get; private set; }
    }
}
