Exemplo n.º 1
0
        private void SafeInvokeScreenshotReceived(ScreenshotReceivedEventArgs eventArgs)
        {
            if (ScreenshotReceived == null)
            {
                return; //No Listeners
            }
            ScreenshotReceivedEvent listener = null;
            var dels = ScreenshotReceived.GetInvocationList();

            foreach (var del in dels)
            {
                try
                {
                    listener = (ScreenshotReceivedEvent)del;
                    listener.Invoke(eventArgs);
                }
                catch (Exception)
                {
                    //Could not reach the destination, so remove it
                    //from the list
                    ScreenshotReceived -= listener;
                }
            }
        }
Exemplo n.º 2
0
        private void SafeInvokeScreenshotReceived(ScreenshotReceivedEventArgs eventArgs)
        {
            if (ScreenshotReceived == null)
                return; //No Listeners

            ScreenshotReceivedEvent listener = null;
            var dels = ScreenshotReceived.GetInvocationList();

            foreach (var del in dels)
            {
                try
                {
                    listener = (ScreenshotReceivedEvent) del;
                    listener.Invoke(eventArgs);
                }
                catch (Exception)
                {
                    //Could not reach the destination, so remove it
                    //from the list
                    ScreenshotReceived -= listener;
                }
            }
        }