Ejemplo n.º 1
0
 void dialog_OnComplete(object sender, AccountAskDialogArgs e)
 {
     AccountAskDialog dialog = sender as AccountAskDialog;
     if (dialog != null) {
         try {
             ActionAccountAskArg arg = _waiting[dialog];
             arg.ParentLayout.Children.Remove(dialog.Dialog);
             arg.Result = e;
             Done(arg);
         } catch (Exception ex) {
             //throw ex;
         }
     } else {
         Exception ex = new Exception("Action Ask dialog error");
         //throw ex;
     }
 }
Ejemplo n.º 2
0
        void show(ActionAccountAskArg arg)
        {
            var dispatcher = ActionHelper.getCurrentUIThread();

            dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                AccountAskDialog dialog = null;
                if (arg.IsRequire)
                {
                    dialog = new AccountAskDialog(AccountAskDialogType.TypeOk);
                }
                else
                {
                    dialog = new AccountAskDialog(AppObject.GameInfo.AccountDialogType);
                }
                dialog.OnComplete += dialog_OnComplete;
                arg.ParentLayout.Children.Add(dialog.Dialog);
                dialog.show();
                _waiting.Add(dialog, arg);
            });
        }
Ejemplo n.º 3
0
 void notify_dialog_OnComplete(object sender, AccountRequireDialogArgs a)
 {
     var dialog = sender as Dialogs.DialogBase;
     var arg = _waiting[dialog];
     arg.ParentLayout.Children.Remove(dialog.Dialog);
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         AccountAskDialog askdialog = null;
         if (arg.IsRequire)
         {
             askdialog = new AccountAskDialog(AccountAskDialogType.TypeOk);
         }
         else
         {
             askdialog = new AccountAskDialog(AppObject.GameInfo.AccountDialogType);
         }
         askdialog.OnComplete += dialog_OnComplete;
         arg.ParentLayout.Children.Add(askdialog.Dialog);
         askdialog.show();
         _waiting.Add(askdialog, arg);
     });
 }
Ejemplo n.º 4
0
 public override void Do(ActionArgs e)
 {
     Begin(e);
     if (precheckToDo(e)) {
         ActionAccountAskArg arg = e as ActionAccountAskArg;
             Deployment.Current.Dispatcher.BeginInvoke(() => {
                 AccountAskDialog dialog = null;
                 if (arg.IsRequire)
                 {
                     dialog = new AccountAskDialog(AccountAskDialogType.TypeOk);
                 }
                 else
                 {
                     dialog = new AccountAskDialog(AppObject.GameInfo.AccountDialogType);
                 }
                 dialog.OnComplete += dialog_OnComplete;
                 arg.ParentLayout.Children.Add(dialog.Dialog);
                 dialog.show();
                 _waiting.Add(dialog, arg);
             });
     } else {
         Cancel(e);
     }
 }