Esempio n. 1
0
        protected void OnLoginFinished(bool result, Account account)
        {
            this.command.Enabled = true;
            if (result)
            {
                /* login successed */
                if (log.IsDebugEnabled)
                {
                    log.Debug("login successed.");
                }

                IProgressTask <float> task = this.viewModel.LoadScene();
                task.OnPreExecute(() =>
                {
                    this.command.Enabled = false;/*by databinding, auto set button.interactable = false. */
                }).OnFinish(() =>
                {
                    this.command.Enabled = true;/*by databinding, auto set button.interactable = true. */
                    this.Dismiss();
                }).Start();
            }
            else
            {
                /* login cancelled */
                if (log.IsDebugEnabled)
                {
                    log.Debug("login cancelled.");
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        ///  Simulate a loading task.
        /// </summary>
        public void Unzip()
        {
            Loading loading            = null;
            IProgressTask <float> task = this.viewModel.Unzip();

            task.OnPreExecute(() =>
            {
                loading = Loading.Show();
                this.command.Enabled = false;/*by databinding, auto set button.interactable = false. */
            }).OnFinish(() =>
            {
                loading.Dispose();
                this.OpenLoginWindow();
                this.command.Enabled = true;/*by databinding, auto set button.interactable = true. */
            }).Start(30);
        }