private void _getLogin(Action<String> callback) { if (this.FOwner.ConnectionState != ConnectionState.Canceled) { FrmLoginBase vFrm = new FrmLoginBase(); //Deployment.Current.Dispatcher.BeginInvoke(new Action(() => { // vFrm = new FrmLoginBase(); //})); String vLastUsrName = (this.FOwner.Env != null) ? this.FOwner.Env.ConfigRoot.LastLoggedInUserName : null; vFrm.SetUsrName(vLastUsrName); Boolean vSaveUsrPwd = (this.FOwner.Env != null) ? this.FOwner.Env.ConfigRoot.SavePassword : false; if (vSaveUsrPwd) { String vLastUsrPwd = (this.FOwner.Env != null) ? this.FOwner.Env.ConfigRoot.LastLoggedInUserPwd : null; vFrm.SetUsrPwd(vLastUsrPwd); } vFrm.SetVerInfo((this.FOwner.Env != null) ? this.FOwner.Env.UserAgentTitleAndVer : this.FOwner.UserAgentTitleAndVer); try { vFrm.ShowM(callback); } catch (ObjectDisposedException) { if (callback != null) callback(null); } } else { if (callback != null) callback(null); } }
private void _getLogin(Action<String> callback) { if (this._owner.ConnectionState != ConnectionState.Canceled) { var frm = new FrmLoginBase(); var lastUsrName = BioEnvironment.Instance.ConfigRoot.LastLoggedInUserName; frm.SetUsrName(lastUsrName); var saveUsrPwd = BioEnvironment.Instance.ConfigRoot.SavePassword; if (saveUsrPwd) { var lastUsrPwd = BioEnvironment.Instance.ConfigRoot.LastLoggedInUserPwd; frm.SetUsrPwd(lastUsrPwd); } frm.SetVerInfo(BioEnvironment.Instance.UserAgentTitleAndVer); try { frm.ShowM(callback); } catch (ObjectDisposedException) { if (callback != null) callback(null); } } else { if (callback != null) callback(null); } }