예제 #1
0
        private void OnThumbnailReady(IThumbnailProvider dw, ThumbnailReadyHandler callback, Surface thumb)
        {
            Pair <IThumbnailProvider, Surface> data = Pair.Create(dw, thumb);
            ThumbnailReadyArgs e = new ThumbnailReadyArgs(data);

            lock (this.thumbnailReadyInvokeList)
            {
                this.thumbnailReadyInvokeList.Add(new ThumbnailReadyEventDetails(callback, this, e));
            }

            try
            {
                this.syncContext.BeginInvoke(new Procedure(DrainThumbnailReadyInvokeList), null);
            }

            catch (ObjectDisposedException)
            {
                // Ignore this error
            }

            catch (InvalidOperationException)
            {
                // If syncContext was destroyed, then ignore
            }
        }
예제 #2
0
        private void OnThumbnailReady(IThumbnailProvider dw, ThumbnailReadyHandler callback, Surface thumb)
        {
            Pair <IThumbnailProvider, Surface> data = new Pair <IThumbnailProvider, Surface>(dw, thumb);
            ThumbnailReadyArgs e = new ThumbnailReadyArgs(data);

            lock (this.thumbnailReadyInvokeList)
            {
                this.thumbnailReadyInvokeList.Add(new Triple <ThumbnailReadyHandler, object, ThumbnailReadyArgs>(callback, this, e));
            }

            try
            {
                //this.syncContext.BeginInvoke(callback, new object[] { this, e });
                this.syncContext.BeginInvoke(new Procedure(DrainThumbnailReadyInvokeList), null);
            }

            catch (InvalidOperationException)
            {
                // If syncContext was destroyed, then ignore
            }
        }
예제 #3
0
        private void OnThumbnailReady(IThumbnailProvider dw, ThumbnailReadyHandler callback, Surface thumb)
        {
            Pair<IThumbnailProvider, Surface> data = Pair.Create(dw, thumb);
            ThumbnailReadyArgs e = new ThumbnailReadyArgs(data);

            lock (this.thumbnailReadyInvokeList)
            {
                this.thumbnailReadyInvokeList.Add(new ThumbnailReadyEventDetails(callback, this, e));
            }

            try
            {
                this.syncContext.BeginInvoke(new Procedure(DrainThumbnailReadyInvokeList), null);
            }

            catch (ObjectDisposedException)
            {
                // Ignore this error
            }

            catch (InvalidOperationException)
            {
                // If syncContext was destroyed, then ignore
            }
        }