protected virtual void OnResultObtained(NotificationResult result) { EventHandler<ResultObtainedEventArgs> handler = this.ResultObtained; if (handler != null) { handler(this, new ResultObtainedEventArgs(result)); } }
public virtual bool TryGetResultDuringSpecifiedTime(int millisecondsToWait, out NotificationResult result) { result = null; if (!this.RealTask.ResultWaitHandle.WaitOne(millisecondsToWait)) { return false; } result = this.RealTask.ObtainedResult; return true; }
public ResultObtainedEventArgs(NotificationResult result) { this.Result = result; }
public ResultObtainedEventArgs(NotificationResult result) { this.Result = result; }
public virtual void SetResult(NotificationResult result) { this.ObtainedResult = result; this.ResultWaitHandle.Set(); }
protected virtual bool SetResultIfStillNeed(NotificationResult result) { if (this.Result.Code != ResultCode.Unspecified) { return false; } this.Result = result; return true; }
protected virtual void SetResultNotifyInterestedMen(NotificationResult result) { this.Result = result; this.OnResultObtained(this.Result); }
public virtual bool TryGetResultDuringSpecifiedTime(int millisecondsToWait, out NotificationResult result) { result = this.GetResultWithWait(); return true; }