private void OnRaiseDisplaySettingsChanged(object sender, EventArgs e) { // change if changed if (SecondaryScreenAvailable && ScreenManager.SecondaryScreen == null) // true -> false SecondaryScreenAvailable = false; else if (!SecondaryScreenAvailable && ScreenManager.SecondaryScreen != null) // false -> true SecondaryScreenAvailable = true; else return; // false -> false || true -> true : no change // fire event var isavail = new SAvailableEventArgs(SecondaryScreenAvailable); EventHandler<SAvailableEventArgs> handler = SecondaryScreenAvailableChanged; if (handler != null) handler(this, isavail); }
private void OnRaiseDisplaySettingsChanged(object sender, EventArgs e) { // change if changed if (SecondaryScreenAvailable && ScreenManager.SecondaryScreen == null) // true -> false { SecondaryScreenAvailable = false; } else if (!SecondaryScreenAvailable && ScreenManager.SecondaryScreen != null) // false -> true { SecondaryScreenAvailable = true; } else { return; // false -> false || true -> true : no change } // fire event var isavail = new SAvailableEventArgs(SecondaryScreenAvailable); EventHandler <SAvailableEventArgs> handler = SecondaryScreenAvailableChanged; if (handler != null) { handler(this, isavail); } }