Esempio n. 1
0
        private void ShowLoadingLayerAutoClose()
        {
            LoadingLayer ll = new LoadingLayer(this, .8D, true);

            ll.ShowAutoClose(o =>
            {
                LoadingLayer layer = (LoadingLayer)o;

                for (int i = 0; i < 10; i++)
                {
                    Thread.Sleep(500);
                    int progress = (i + 1) * 10;
                    layer.UpdateProgress(progress, $"当前进度 {progress}%");
                }
            }, ll);
        }
Esempio n. 2
0
        private void ShowLoadingLayerManualClose()
        {
            LoadingLayer ll = new LoadingLayer(this, .8D, true);

            ThreadPool.QueueUserWorkItem(o =>
            {
                LoadingLayer layer = (LoadingLayer)o;

                for (int i = 0; i < 10; i++)
                {
                    Thread.Sleep(500);
                    int progress = (i + 1) * 10;
                    layer.UpdateProgress(progress, $"当前进度 {progress}%");
                }

                layer.Close();
            }, ll);

            ll.Show();
        }
Esempio n. 3
0
        private void btnLoadingLayer_Click(object sender, EventArgs e)
        {
            using (LoadingLayer ll = new LoadingLayer(this, .8D, true))
            {
                ThreadPool.QueueUserWorkItem(o =>
                {
                    LoadingLayer layer = (LoadingLayer)o;

                    for (int i = 0; i < 10; i++)
                    {
                        Thread.Sleep(500);
                        int progress = (i + 1) * 10;
                        layer.UpdateProgress(progress, $"当前进度 {progress}%");
                    }

                    layer.Close();
                }, ll);

                ll.Show();
            }
        }