private void stateBox_Click(object sender, RoutedEventArgs e) { CloseDialog close = new CloseDialog(peerList); close.Show(); }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { bool bootstrap = false; foreach (Peer p in peerList) if (p.machine.ReloadConfig.IsBootstrap) bootstrap = true; if (peerList.Count > 0 && !bootstrap) { e.Cancel = true; CloseDialog closeDialog = new CloseDialog(peerList); closeDialog.Show(); foreach (Peer p in peerList) { if (!p.machine.ReloadConfig.IsBootstrap) p.machine.SendCommand("Leave"); } } }