private Stream GetState(TrackingContext trackingContext) { if (trackingContext == null) { trackingContext = TrackingContext.GetInstance(Guid.NewGuid(), this.Path); } MessageSession.TraceGetState(EventTraceActivity.CreateFromThread(), trackingContext, this.SessionId); return(this.OnGetState(trackingContext, this.OperationTimeout)); }
public IAsyncResult BeginGetState(AsyncCallback callback, object state) { IAsyncResult asyncResult; base.ThrowIfDisposed(); try { TrackingContext instance = TrackingContext.GetInstance(Guid.NewGuid(), this.Path); MessageSession.TraceGetState(EventTraceActivity.CreateFromThread(), instance, this.SessionId); MessageSession.RetrySessionAsyncResult retrySessionAsyncResult = new MessageSession.RetrySessionAsyncResult(this, instance, MessageSession.SessionOperation.GetState, null, this.OperationTimeout, callback, state); retrySessionAsyncResult.Start(); asyncResult = retrySessionAsyncResult; } catch (Exception exception1) { Exception exception = exception1; if (!Fx.IsFatal(exception)) { throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.AsError(exception, null); } throw; } return(asyncResult); }