private void btnExit_Click(object sender, RoutedEventArgs e) { DlgPassword dlg = new DlgPassword(); dlg.Owner = Application.Current.MainWindow; if (dlg.ShowDialog() == true) { this.Close(); } }
private void btnLockOn_Click(object sender, RoutedEventArgs e) { DlgPassword dlg = new DlgPassword(); dlg.Owner = Application.Current.MainWindow; if (dlg.ShowDialog() == true) { MELSEC.SetDevice("M003150", 0); // Open MELSEC.SetDevice("M003151", 1); // Close } }
private void btnLockOff_Click(object sender, RoutedEventArgs e) { if (randomRead.GetData("L3109") != 1) { MessageBox.Show("Not mantance mode, please change mode."); return; } DlgPassword dlg = new DlgPassword(); dlg.Owner = Application.Current.MainWindow; if (dlg.ShowDialog() == true) { MELSEC.SetDevice("M003150", 1); // Open MELSEC.SetDevice("M003151", 0); // Close DlgMaintrance dlg2 = new DlgMaintrance(); dlg2.Owner = Application.Current.MainWindow; dlg2.ShowDialog(); } }