System.ComponentModel.Async.Complete C# (CSharp) Method

Complete() protected method

Completes the associated task with the specified result.
protected Complete ( object result ) : void
result object The result of completing the task.
return void
        protected void Complete(object result)
        {
            Complete(result, null);
        }

Same methods

Async::Complete ( Exception error ) : void
Async::Complete ( object result, Exception error ) : void

Usage Example

Example #1
0
        public Async<Profile> GetProfile(string userName)
        {
            Async<Profile> asyncProfile = new Async<Profile>();

            _twitterService.GetProfile(userName, delegate(Profile profile) {
                if (profile == null) {
                    asyncProfile.Complete(new Exception("The profile for '" + userName + "' could not be loaded."));
                }
                else {
                    asyncProfile.Complete(profile);
                }
            });

            return asyncProfile;
        }
All Usage Examples Of System.ComponentModel.Async::Complete