static public void ReceiveConnectionError(MyTabManagement Item) { MessageBoxResult res = MessageBox.Show("Il Server " + Item.MyTab.TabServerIP + " non risponde, vuoi riprovare?", "Attenzione!", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (res == MessageBoxResult.No) { Item.MyTab.MainWndw.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => { Item.MyTab.MainWndw.Error = true; Item.MyTab.MainWndw.CloseTab(Item.MyTab); })); } if (res == MessageBoxResult.Yes) { Item.MyTab.MainWndw.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => { //codice di connect NewConnection C = new NewConnection(); C.Show(); Item.MyTab.MainWndw.Error = true; //codice di disconnect if (Item != null) { Item.MyTab.MainWndw.CloseTab(Item.MyTab); } })); } }
// Funzione associata al tasto del Menù File->Connetti. Apre il menu di connessione. private void Menu_Connect_Click(object sender, RoutedEventArgs e) { NewConnection C = new NewConnection(); C.Show(); }