//回调 private void Child_PassDataBetweenForm(object sender, PassDataWinFormEventArgs e) { SiginButton.Content = e.Account; ConfigAppSettings.SetValue("Account", e.Account); ConfigAppSettings.SetValue("Password", e.Key); //ObservableCollection<Authority> authorities = Post.GetAuthorityList(); //PageMain.thelist = getFileName(Post.GetAuthorityList()); isSigined = true; if (MainWindow.isSigined) { //ObservableCollection<Authority> mainlist = getFileName(Post.GetAuthorityList()); ObservableCollection <Authority> mainlist = Post.GetAuthorityList(); foreach (Authority item in mainlist) { item.File_Name = item.File_Path.Split('/').Last(); //item.File_Path.Replace("/", "\\"); item.File_Path = item.File_Path.Replace("/", "\\"); PageMain.thelist.Add(item); } Console.WriteLine(DesktopApplication.Properties.Settings.Default.firstLogin); } //PageHistory.refreshchart(); //Console.WriteLine("thelist.COUNT" + PageMain.thelist.Count + ""); }
//书写子窗体确认按钮的代码如下: private void SiginButton_Click(object sender, RoutedEventArgs e) { String Account, Key; Account = AccountTextBox.Text; Key = KeyTextBox.Password; if (Post.HttpLogin(Account, Key)) { PassDataWinFormEventArgs args = new PassDataWinFormEventArgs(Account, Key); PassDataBetweenForm(this, args); this.Close(); } }
private void KeyTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { String Account, key; Account = AccountTextBox.Text; key = KeyTextBox.Password; if (Post.HttpLogin(Account, key)) { PassDataWinFormEventArgs args = new PassDataWinFormEventArgs(Account, key); PassDataBetweenForm(this, args); this.Close(); } } }