private void InitLogin() { Excel2007Addin.Settings settings = Excel2007Addin.Settings.Default; this._login = new Login(_user); _login.authSuccessful += new Login.AuthSuccessful(User_Successful_Login); _login.logOut += new Login.Logout(User_Logout); _login.Username = settings.Username; _login.Password = DataProtectionHelper.UnProtect(settings.Password); _login.RememberPassword = settings.RememberPassword; if (_login.ShowDialog().GetValueOrDefault(false)) { settings.RememberPassword = _login.RememberPassword; settings.Username = _login.Username; if (_login.RememberPassword) settings.Password = DataProtectionHelper.Protect(_login.Password); else settings.Password = DataProtectionHelper.Protect(""); settings.Save(); } }
public App() { InitializeComponent(); MainPage = new Login(); }