コード例 #1
0
        private void ExecuteLoginCommand()
        {
            Message = null;
            IsBusy  = true;

            Action act = () =>
            {
                if (RememberPassword || AutoLogin)
                {
                    IsolatedStorageHelper.Save(LocalData.Transfer(this));
                }
                else if (!RememberPassword)
                {
                    IsolatedStorageHelper.Delete <LocalData>();
                }

                CommunicateManager.Invoke <ILoginService>(p =>
                {
                    var token           = p.Login(Num, LoginName, LoginPwd);
                    LoginInfo.Token     = token;
                    LoginInfo.Code      = Num.Trim();
                    LoginInfo.Account   = LoginName.Trim();
                    LoginInfo.Guid      = Guid.NewGuid();
                    LoginInfo.IsLogined = true;
                    //登录成功
                    IsLogined = true;
                }, ShowErr);
            };

            Task.Factory.StartNew(act).ContinueWith(task =>
            {
                CommunicateManager.StartPushMessage();
                InvokeSetBusy(false);
            });
        }
コード例 #2
0
ファイル: LoginModel.cs プロジェクト: Maiahii/Shop
 public void Trim()
 {
     LoginName = LoginName.Trim();
     LoginPwd  = LoginPwd.Trim();
     Email     = Email.Trim();
     if (!string.IsNullOrEmpty(AppKey))
     {
         AppKey = AppKey.Trim();
     }
 }