예제 #1
0
        internal HpScheduleSubContext(HpScheduleContext context, int progress_max)
        {
            this.context  = context;
            this.progress = 0;

            decimal progress_width = (decimal)(progress_max - context.progress);

            this.progress_multi_only   = progress_width / 100;
            this.progress_multi_parent = 1;
            this.progress_base_only    = context.progress == null ? 0 : context.progress.Value;
            this.progress_base_parent  = 0;

            this.progress_multi = this.progress_multi_parent * this.progress_multi_only;
            this.progress_base  = this.progress_base_only * this.progress_multi_parent;
        }
예제 #2
0
        public override void Execute(HpScheduleContext context)
        {
            context.Log("开始", 0);

            //int i = 0;

            //context.createSubJob(20, (ctx) =>
            //{
            //    i++;
            //    ctx.Log("SUB-1", 30);
            //    ctx.Log("SUB-2", 60);
            //    ctx.createSubJob(80, (ctx2) => {

            //        i++;
            //        ctx2.Log("SUB-2-1", 20);

            //        ctx2.createSubJob(30, (ctx3) =>
            //        {
            //            ctx3.Log("SUB-3-1", 40);
            //            ctx3.Log("SUB-3-2", 75);
            //            ctx3.Log("SUB-3-3", 100);
            //        });

            //        ctx2.Log("SUB-2-2", 40);
            //        ctx2.Log("SUB-2-3", 75);
            //        ctx2.Log("SUB-2-4", 100);
            //    });
            //    ctx.Log("SUB-3", 100);
            //});

            context.Log("第一步完成", 30);

            Thread.Sleep(2000);

            context.Log("第二步完成", 60);

            context.Log("调试信息输出");

            context.Log("结束", 100);
        }