protected virtual void OnGetPersonInfoCompleted(PersonInfoCompletedEventArgs e) { if (GetPersonInfoCompleted != null) { GetPersonInfoCompleted(this, e); } }
private void GetPersonInfoWorker(int id, object userState, AsyncOperation asyncOp) { Exception exception = null; Person person = null; try { person = GetPersonInfo(id); } catch (Exception ex) { exception = ex; } PersonInfoCompletedEventArgs args = new PersonInfoCompletedEventArgs(person, exception, false, userState); asyncOp.PostOperationCompleted(delegate(object e) { OnGetPersonInfoCompleted((PersonInfoCompletedEventArgs)e); }, args); }