Esempio n. 1
0
        private void StartBitmapCompleteWaiter()
        {
            Task <bool> onCompleted = new Task <bool>(
                delegate()
            {
                BitmapCompletedDelegate localBitmapCompleted = this.BitmapCompleted;
                Task <ManagedBitmap> bitmap = this.bitmap;

                if (bitmap == null)     // object disposed before task started
                {
                    return(false);
                }

                bitmap.Wait();

                if (localBitmapCompleted != null)
                {
                    localBitmapCompleted.Invoke(this, EventArgs.Empty);
                }

                return(false);
            });

            onCompleted.Start();
        }
Esempio n. 2
0
        private void StartBitmapCompleteWaiter()
        {
            Task <bool> onCompleted = new Task <bool>(
                delegate()
            {
                this.bitmap.Wait();
                BitmapCompletedDelegate localBitmapCompleted = this.BitmapCompleted;
                if (localBitmapCompleted != null)
                {
                    localBitmapCompleted.Invoke(this, EventArgs.Empty);
                }
                return(false);
            });

            onCompleted.Start();
        }