private void LoadingComplete() { LoadAndVerificationCompletedHandler callback = this._callback; IDictionary <DeviceAssetImages, Image> result = this._imagesAreValid ? _images : null; Application.DeferredInvoke(delegate { callback(result); }, null); this._paths = null; this._imagesToLoad = null; this._callback = null; }
public void LoadAndVerify( IList <string> paths, IList <ImageIdAndConstraint> imagesToLoad, LoadAndVerificationCompletedHandler callback) { if (!Application.IsApplicationThread) { throw new Exception("DeviceIconSet loading is only supported on the application thread. This feature is not thread-safe."); } if (this._paths != null) { throw new Exception("LoadAndVerify was called while a set was already being built. Calls to LoadAndVerify cannot be reentrant."); } if (paths == null) { throw new ArgumentNullException("path"); } if (imagesToLoad == null) { throw new ArgumentNullException(nameof(imagesToLoad)); } if (callback == null) { throw new ArgumentNullException(nameof(callback)); } this._paths = paths; this._imagesToLoad = imagesToLoad; this._callback = callback; this._asynchronousLoadsRemaining = 0; this._imagesAreValid = true; this._images = new Dictionary <DeviceAssetImages, Image>(23, DeviceAssetImagesEqualityComparer.Instance); Application.DeferredInvoke(delegate { this.LoadAndVerifyWorker(); }, null); }