public void ShowBlocking(Rectangle rectangle, Color color, int durationInMs) { _dispatcher.Invoke(() => { var win = new OverlayRectangleWindow(rectangle, color, durationInMs); win.ShowDialog(); }); }
public void Show(Rectangle rectangle, Color color, int durationInMs) { if (rectangle.IsValid) { _dispatcher.Invoke(() => { var win = new OverlayRectangleWindow(rectangle, color, durationInMs); win.Show(); }); } }
public void ShowBlocking(Rectangle rectangle, Color color, int durationInMs) { if (rectangle.IsValid) { _dispatcher.Invoke(new Action(() => { _currWin?.Close(); var win = new OverlayRectangleWindow(rectangle, color, durationInMs); win.ShowDialog(); _currWin = win; })); } }
public void ShowBlocking(Rectangle rectangle, Color color, int durationInMs) { if (!rectangle.IsEmpty) { // ReSharper disable once RedundantDelegateCreation Used for older .Net versions _dispatcher.Invoke(new Action(() => { _currWin?.Close(); var win = new OverlayRectangleWindow(rectangle, color, durationInMs); win.ShowDialog(); _currWin = win; })); } }