码迷,mamicode.com
首页 > 其他好文 > 详细

BaseJob

时间:2014-07-23 11:45:06      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   for   re   

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsFormsApplication3.Model;
using WindowsFormsApplication3.Enums;
using WindowsFormsApplication3.DataStorge;

namespace WindowsFormsApplication3.Jobs
{
    public class BaseJob
    {
        public delegate void JobStateChangeHanlder();
        public event JobStateChangeHanlder JobStateChangeEvent;

        public void ReportJobStateChange()
        {
            if (JobStateChangeEvent != null)
            {
                JobStateChangeEvent();
            }
        }
        public virtual string Action {
            get { return string.Empty; }
        }

        protected CheckoutContext checkoutContext;
        protected CheckoutStep checkoutStep;

        protected CheckoutContext step;
        public CheckoutContext Step {
            get { return step; }
        }

        protected string message;
        public string Message {
            get { return message; }
        }

        protected JobStatus status;
        public JobStatus Status {
            get { return status; }
        }

        public BaseJob(CheckoutContext checkoutContext, CheckoutStep checkoutStep) {
            this.checkoutContext = checkoutContext;
            this.checkoutStep = checkoutStep;
            Reset();
        }

        public virtual void Execute(object _stateInfo)
        {
            message = string.Empty;
            status = JobStatus.Processing;
        }

        public virtual void Reset() {
            message = string.Empty;
            status = JobStatus.Waiting;
        }


    }
}

BaseJob,布布扣,bubuko.com

BaseJob

标签:style   blog   color   io   for   re   

原文地址:http://www.cnblogs.com/rosizel/p/3861624.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!