using MW.WorkFlow;
using System.Diagnostics;
using System.Threading.Tasks;

namespace MainShell.Process
{
    public class WaferAngleAdjustmentActivity : ActivityAbstractBase
    {
        public WaferAngleAdjustmentActivity(string name) : base(name)
        {
        }

        protected override async Task<ActivityResult> OnExecuteAsync(WorkflowContext context, ActivityControl activityControl)
        {
            Trace.WriteLine("Executing WaferAngleAdjustmentActivity");

            for (int i = 0; i < 20; i++)
            {
                activityControl.ThrowIfCancellationRequested();
                await activityControl.CheckPauseAsync().ConfigureAwait(false);
                await Task.Delay(100, activityControl.CancellationToken).ConfigureAwait(false);
            }

            return ActivityResult.Success;
        }
    }
}
