public PageRecoveryAccount1(SubwindowRouter sr)
        {
            _sr = sr;
            InitializeComponent();

            _sr.InteractiveTask(() =>
            {
                int ret;

                if (!SubwindowDataCollector.Collect(5 * 60 * 1000, out var service, out var character))
                {
                    Growl.Error("等待超时,请返回上一页重试");
                }

                _sr.Procedure = null;
                var local     = new RecoveryProcedure();

                try
                {
                    if (string.IsNullOrEmpty(_sr.Username))
                    {
                        ret = 02_0009;
                        goto FAIL;
                    }

                    ret = local.Step1(_sr.Username, service, character, Helper.GetTrace());
                }
                catch (HttpRequestException ex)
                {
                    ret = 02_0000 + (int)(ex.Data["StatusCode"]);
                }
                catch (Exception)
                {
                    ret = 02_0000;
                }

                FAIL:
                if (CheckVendor.NotValidResponseCode(ret))
                {
                    Growl.Error(MessageVendor.FormatError(ret));
                }
                else
                {
                    _sr.Procedure = local;
                    SubwindowNavigator.Navigate(SubwindowPage.Recovery2);
                }
            });
        }
Пример #2
0
        public PageRegister1(SubwindowRouter sr)
        {
            _sr = sr;
            InitializeComponent();

            _sr.InteractiveTask(() =>
            {
                _sr.Service   = null;
                _sr.Character = null;

                if (!SubwindowDataCollector.Collect(5 * 60 * 1000, out _sr.Service, out _sr.Character))
                {
                    Growl.Error("等待超时,请返回上一页重试");

                    return;
                }

                if (_sr.Service != null && _sr.Character != null)
                {
                    SubwindowNavigator.Navigate(SubwindowPage.Register2);
                }
            });
        }