Пример #1
0
        public static void Loader()
        {
            var chain = new ProgressChain();

            chain.OnChange += delegate { SplashScreen.Progress = chain.Progress * 0.7f; };

            chain.AddTask(delegate(ProgressHandler handler)
            {
                if (Configuration.Load(handler) == Configuration.ResultCode.ERROR)
                {
                }
            }, 30f);

            chain.AddTask(delegate(ProgressHandler handler)
            {
                if (DynamicTypes.Load(handler) == DynamicTypes.ResultCode.ERROR)
                {
                }
            }, 10f);

            chain.AddTask(delegate(ProgressHandler handler)
            {
                if (GuiConfiguration.Load(handler) == GuiConfiguration.ResultCode.ERROR)
                {
                    handler.Progress = 100f;
                }
            }, 30f);

            chain.Start();

            /*if (DynamicTypes.Load() == DynamicTypes.ResultCode.OK)
             * {
             *  SplashScreen.Progress = 100;
             * }*/
        }
Пример #2
0
 public Task(ProgressChain chain, float weight, TaskMethod method)
 {
     Weight               = weight;
     Chain                = chain;
     Progress             = new ProgressHandler();
     Progress.OnChange   += (s, e) => { chain.ProgressChanged(); };
     Progress.OnComplete += (s, e) => { chain.Next(); };
     Method               = method;
 }
Пример #3
0
        public static void Loader()
        {
            ProgressChain chain = new ProgressChain();
            chain.OnChange += delegate()
            {
                SplashScreen.Progress = chain.Progress * 0.7f;
            };

            chain.AddTask(delegate(ProgressHandler handler)
            {
                if (Configuration.Load(handler) == Configuration.ResultCode.ERROR)
                {

                }
            }, 30f);

            chain.AddTask(delegate(ProgressHandler handler)
            {
                if (DynamicTypes.Load(handler) == DynamicTypes.ResultCode.ERROR)
                {

                }
            }, 10f);

            chain.AddTask(delegate(ProgressHandler handler)
            {
                if (GUIConfiguration.Load(handler) == GUIConfiguration.ResultCode.ERROR)
                {
                    handler.Progress = 100f;
                }
            }, 30f);

            chain.Start();
                /*if (DynamicTypes.Load() == DynamicTypes.ResultCode.OK)
                {
                    SplashScreen.Progress = 100;
                }*/
        }
Пример #4
0
 public Task(ProgressChain chain, float weight, ProgressChain.TaskMethod method)
 {
     this.Weight = weight;
     this.chain = chain;
     Progress = new ProgressHandler();
     Progress.OnChange += (s, e) =>
     {
         chain.ProgressChanged();
     };
     Progress.OnComplete += (s, e) =>
     {
         chain.Next();
     };
     Method = method;
 }