From 7cf3d2caa19da076ebd3539c8786ce62a53d35f9 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 8 Nov 2016 16:31:07 -0800 Subject: Network list window opens with click on the menu item --- windows/WinUI/APIHandler.cs | 14 ++- windows/WinUI/MainWindow.xaml | 132 --------------------------- windows/WinUI/MainWindow.xaml.cs | 166 ---------------------------------- windows/WinUI/NetworkInfoView.xaml.cs | 12 +-- windows/WinUI/NetworkList.xaml | 132 +++++++++++++++++++++++++++ windows/WinUI/NetworkList.xaml.cs | 153 +++++++++++++++++++++++++++++++ windows/WinUI/NetworksPage.xaml.cs | 8 -- windows/WinUI/ToolbarItem.xaml | 6 +- windows/WinUI/ToolbarItem.xaml.cs | 28 +++++- windows/WinUI/WinUI.csproj | 6 +- 10 files changed, 336 insertions(+), 321 deletions(-) delete mode 100644 windows/WinUI/MainWindow.xaml delete mode 100644 windows/WinUI/MainWindow.xaml.cs create mode 100644 windows/WinUI/NetworkList.xaml create mode 100644 windows/WinUI/NetworkList.xaml.cs (limited to 'windows') diff --git a/windows/WinUI/APIHandler.cs b/windows/WinUI/APIHandler.cs index f2fb1d21..9cddd916 100644 --- a/windows/WinUI/APIHandler.cs +++ b/windows/WinUI/APIHandler.cs @@ -19,7 +19,8 @@ namespace WinUI private string url = null; - private static APIHandler instance; + private static volatile APIHandler instance; + private static object syncRoot = new Object(); public static APIHandler Instance { @@ -27,7 +28,16 @@ namespace WinUI { if (instance == null) { - + lock (syncRoot) + { + if (instance == null) + { + if (!initHandler()) + { + return null; + } + } + } } return instance; diff --git a/windows/WinUI/MainWindow.xaml b/windows/WinUI/MainWindow.xaml deleted file mode 100644 index 9d4a9fc1..00000000 --- a/windows/WinUI/MainWindow.xaml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -