예제 #1
0
        public App()
        {
            Exception exLog = Logger.CreateLog("AirPodsUI Settings");

            if (exLog != null)
            {
                MessageBox.Show("Unable to create logging component. Logging will be unavailable.\n\n" + exLog.Message, "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
            }

            Logger.Log(LogType.Information, "Created logger!");

            try
            {
                NavPages = new Dictionary <string, Type>();
                Devices  = new List <Device>();
                Devices  = DevicesJson.GetDevices();
                OnDevicesChanged?.Invoke(this, new EventArgs());
            }
            catch (Exception e)
            {
                Logger.Log(LogType.Error, "Unable to get devices!", e);
                MessageBox.Show("There was an error trying to get the devices. Please see the log for more details. Shutting down.\n\n" + Logger.LogFile, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                Shutdown();
            }
        }
예제 #2
0
 public static void InvokeDeviceChange(object sender)
 {
     OnDevicesChanged?.Invoke(sender, new EventArgs());
     Logger.Log(LogType.Information, "Invoked Device Change");
 }