public void DrawOverlayProxyHandler(DrawOverlayEventArgs args) { if (DrawOverlay != null) { DrawOverlay(args); } }
private void SafeInvokeDrawOverlay(DrawOverlayEventArgs drawOverlayEventArgs) { if (DrawOverlay == null) { return; //No Listeners } DrawOverlayEvent listener = null; var dels = DrawOverlay.GetInvocationList(); foreach (var del in dels) { try { listener = (DrawOverlayEvent)del; listener.Invoke(drawOverlayEventArgs); } catch (Exception) { //Could not reach the destination, so remove it //from the list DrawOverlay -= listener; } } }