zoukankan      html  css  js  c++  java
  • BaseWorkerForm : Form

    using System.Collections.Generic;
    using System.Windows.Forms;
    using WindowsFormsApplication3.Enums;
    using WindowsFormsApplication3.Jobs;
    using WindowsFormsApplication3.Model;
    using WindowsFormsApplication3.DataStorge;
    
    
    namespace WindowsFormsApplication3.FormPage
    {
        public class BaseWorkerForm : Form
        {
            public delegate void FormStatusChangedHandler();
            public event FormStatusChangedHandler FormStatusChanged;
            protected int childFormNO;
            public int ChildFormNO{ 
                get{return childFormNO;}}
    
    
            protected CheckoutContext checkoutContext;
            protected List<BaseJob> jobs;
            protected FormStatus status;
            public virtual FormStatus Status {
                get { return status; }
            }
    
            public BaseWorkerForm():this(new CheckoutContext(),CheckoutStep.Introduction){}
            public BaseWorkerForm(CheckoutContext checkoutContext,CheckoutStep checkoutStep):base()
            {
                this.checkoutContext= checkoutContext;
                jobs=new List<BaseJob>();
    
            }
    
            public virtual void Execute(object obj)
            {
                status = FormStatus.Processing;
                ReportChildFormNO();
                ReportFormStatusChanged();
            }
    
            public void ReportFormStatusChanged(){
            if(FormStatusChanged!=null)
                FormStatusChanged();
            }
    
            public virtual void RefreshForm() { 
            }
    
            public virtual void ResetForm() {
                jobs.Clear();
                status = FormStatus.Waiting;
                ReportFormStatusChanged();
            }
    
            public void ReportChildFormNO() {
                childFormNO = 0;
                foreach (var childf in checkoutContext.formHierachy) {
                    if (childf.fatherForm == base.Text)
                        childFormNO++;
                }
            }
    
            public int FinishedChildFormNO(string formname) {
                int finishedFormNO = 0;
                foreach (var childf in checkoutContext.formHierachy)
                {
                    if (childf.fatherForm == formname&&childf.childForm.status==FormStatus.OK)
                        finishedFormNO++;
                }
                return finishedFormNO;
            }
        }
    }
  • 相关阅读:
    mysqldump备份数据库时排除某些库
    Dataguard后台进程解析
    mysql 查看所有存储过程
    Oracle 中的 TO_DATE 和 TO_CHAR 函数
    trunc的使用
    mysql now() sysdate() curdate()区别
    ORA-10456:cannot open standby database;media recovery session may be in process
    ORACLE 修改日志大小及增加日志成员
    Oracle 11gR2用gpnp profile存放ASM的spfile路径
    C语言malloc()函数:动态分配内存空间
  • 原文地址:https://www.cnblogs.com/rosizel/p/3861616.html
Copyright © 2011-2022 走看看