public void Activate(bool UseGameConfig) { if (ManiaPalInstance == null) { ManiaPalInstance = new ManiaPal.MainWindow(); ManiaPalInstance.Closing += ManiaPalInstance_Closing; ManiaPalInstance.Show(); while (ManiaPal.MainWindow.Instance == null) { Thread.Sleep(100); } LoadConfig(UseGameConfig); ManiaPal.MainWindow.Instance.RefreshPalette(ManiaPal.MainWindow.Instance.CurrentPaletteSet); ManiaPal.MainWindow.Instance.Activate(); } else { var MP = ManiaPal.MainWindow.Instance; MP.Activate(); MP.Visibility = System.Windows.Visibility.Visible; RefreshConfig(UseGameConfig); } }
private void ManiaPalInstance_Closing(object sender, System.ComponentModel.CancelEventArgs e) { ManiaPalInstance = null; }