public IDisposable StartScope() { if (this.m_executionScope != null) { throw ExceptionHandlingScope.CreateInvalidUsageException(); } this.m_executionScope = new ExceptionHandlingExecutionScope(this.m_context, this, new ExecutionScopeDisposingCallback(this.ExceptionHandlingScopeDisposingCallback)); this.m_context.PendingRequest.AddQueryIdAndResultObject(this.m_executionScope.Id, this); return(this.m_executionScope); }
public IDisposable StartFinally() { if (this.m_executionScope == null || this.m_executionScope.Disposed || this.m_tryScope == null || !this.m_tryScope.Disposed || (this.m_catchScope != null && !this.m_catchScope.Disposed) || this.m_finallyScope != null) { throw ExceptionHandlingScope.CreateInvalidUsageException(); } ClientAction lastAction = this.m_context.PendingRequest.LastAction; if (lastAction == null || !(lastAction is ClientActionExecutionScopeEnd)) { throw ExceptionHandlingScope.CreateInvalidUsageException(); } if (((ClientActionExecutionScopeEnd)lastAction).Scope.Name != "TryScope" && ((ClientActionExecutionScopeEnd)lastAction).Scope.Name != "CatchScope") { throw ExceptionHandlingScope.CreateInvalidUsageException(); } this.m_finallyScope = new ExecutionScope(this.m_context, "FinallyScope", null); return(this.m_finallyScope); }
public ClientActionExecutionScopeEnd(ExecutionScope scope, string name) : base(scope.Context, null, name) { this.m_scope = scope; }