Esempio n. 1
0
        public void Execute()
        {
            if (CodeToExcute == null)
            {
                return;
            }

            defaultSplashScreen = new WaitDialog()
            {
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner
            };
            CodeToExcute.progressDisplayHelper = defaultSplashScreen;
            var task = new Task(() =>
            {
                var res = CodeToExcute.Execute();
                closeSplash();
                if (AsyncCallBack != null)
                {
                    AsyncCallBack(res);
                }
            });

            task.Start();
            defaultSplashScreen.ShowDialog();
        }
Esempio n. 2
0
        public void Execute()
        {
            if (CodeToExcute == null)
            {
                return;
            }

            defaultSplashScreen = new SplashScreen()
            {
                StartPosition = FormStartPosition.CenterParent
            };
            CodeToExcute.progressDisplayHelper = defaultSplashScreen;
            var task = new Task(() =>
            {
                var res = CodeToExcute.Execute();
                closeSplash();
                if (AsyncCallBack != null)
                {
                    AsyncCallBack(res);
                }
            });

            task.Start();
            defaultSplashScreen.ShowDialog();
        }