From b7285846288f846f97fb00e5ee884f4ce187d460 Mon Sep 17 00:00:00 2001 From: xu Date: Tue, 25 Feb 2020 04:21:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=85=88=E5=BC=80=E6=89=93?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=95=8C=E9=9D=A2=EF=BC=8C=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=8F=96=E6=B6=88=20=E9=80=80=E5=87=BA=E5=BB=B6=E6=97=B61?= =?UTF-8?q?=E7=A7=92=EF=BC=8C=E6=9B=B4=E5=A5=BD=E7=9A=84=E6=B3=A8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plane.FormationCreator/MainWindow.xaml | 1 + Plane.FormationCreator/MainWindow.xaml.cs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/Plane.FormationCreator/MainWindow.xaml b/Plane.FormationCreator/MainWindow.xaml index 694f6f0..a320ac8 100644 --- a/Plane.FormationCreator/MainWindow.xaml +++ b/Plane.FormationCreator/MainWindow.xaml @@ -20,6 +20,7 @@ Width="1920" Height="1080" Closing="Window_Closing" + Loaded="Window_Loaded" > diff --git a/Plane.FormationCreator/MainWindow.xaml.cs b/Plane.FormationCreator/MainWindow.xaml.cs index 4b86f2a..7771201 100644 --- a/Plane.FormationCreator/MainWindow.xaml.cs +++ b/Plane.FormationCreator/MainWindow.xaml.cs @@ -62,7 +62,12 @@ namespace Plane.FormationCreator } private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { + bool waitnet = _copterManager.Logined; _copterManager.NetLogout(); + //等待网络退出 + if (waitnet) + System.Threading.Thread.Sleep(1000); + /* MessageBoxResult result = MessageBox.Show("Do you really want to exit?", "", MessageBoxButton.YesNo); if (result == MessageBoxResult.No) @@ -71,6 +76,15 @@ namespace Plane.FormationCreator } */ } + + private void Window_Loaded(object sender, RoutedEventArgs e) + { + ServiceLocator.Current.GetInstance().LoginCommand.Execute(this); + } + + + + private void btnLogin_Click(object sender, RoutedEventArgs e) { var loginWindow = new ConnectWindow