public void Setting() { if (!ProxyViewShow) { ProxyViewShow = true; return; } else { ProxyViewShow = false; Config.ProxyEnable(ProxyEnable.ToString()); Config.ProxyHost(ProxyHost); Config.ProxyPort(ProxyPort.ToString()); Config.ProxyUser(ProxyUser); Config.ProxyPwd(ProxyPwd); } }
public async void Login() { if (ShowKeyView == Visibility.Visible) { return; } Errlabel = ""; if (Username.IsBlank() || Password.IsBlank()) { Errlabel = "Username or password is err!"; return; } BtnLoginEnable = false; //Proxy TidalTool.PROXY = ProxyEnable ? new HttpHelper.ProxyInfo(ProxyHost, ProxyPort, ProxyUser, ProxyPwd) : null; Config.ProxyEnable(ProxyEnable.ToString()); Config.ProxyHost(ProxyHost); Config.ProxyPort(ProxyPort.ToString()); Config.ProxyUser(ProxyUser); Config.ProxyPwd(ProxyPwd); //Login bool bRet = await Task.Run(() => { return(TidalTool.login(Username, Password)); }); if (!bRet) { Errlabel = "Login Err! " + TidalTool.loginErrlabel; BtnLoginEnable = true; return; } if (Remember) { Config.Username(Username); Config.Password(Password); } BtnLoginEnable = true; VMMain.VMLogin = this; Manager.ShowWindow(VMMain); RequestClose(); return; }