private void btnYes_Click(object sender, RoutedEventArgs e) { if (!Validation.GetHasError(txtInterval) && CheckDisplayMode() && CheckConn()) { appconfig.Password = txtPwd.Password; appconfig.IsConfigUpdated = true; string appStartPath = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); bool cansetautorun = RunWhenStart(ckAutoRun.IsChecked.Value, "Zugger", System.IO.Path.Combine(appStartPath, "Zugger.exe")); IOHelper.SaveIsolatedData(appconfig); this.Close(); } }
private void btnNo_Click(object sender, RoutedEventArgs e) { //revert the config to default appconfig.IsAutoRun = appconfigBack.IsAutoRun; appconfig.IsTaskNotify = appconfigBack.IsTaskNotify; appconfig.IsPATH_INFORequest = appconfigBack.IsPATH_INFORequest; appconfig.Password = appconfigBack.Password; appconfig.PMSHost = appconfigBack.PMSHost; appconfig.RequestInterval = appconfigBack.RequestInterval; appconfig.UserName = appconfigBack.UserName; appconfig.ShowBug = appconfigBack.ShowBug; appconfig.ShowOpendByMe = appconfigBack.ShowOpendByMe; appconfig.ShowTask = appconfigBack.ShowTask; appconfig.ShowStory = appconfigBack.ShowStory; IOHelper.SaveIsolatedData(appconfig); this.Close(); }