コード例 #1
0
ファイル: ImageCache.cs プロジェクト: DOI1234/PhotoMunger
        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();
        }
コード例 #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();
        }