Ejemplo n.º 1
0
 internal static object GetResult(DelegateAsyncResult inst)
 {
     if (inst.exception != null)
         throw inst.exception;
     else
         return inst.result;
 }
Ejemplo n.º 2
0
 internal static object GetResult(DelegateAsyncResult inst)
 {
     if (inst.exception != null)
     {
         throw inst.exception;
     }
     else
     {
         return(inst.result);
     }
 }
Ejemplo n.º 3
0
		public override IAsyncResult BeginGetResponse(AsyncCallback callback, object state)
		{
			GetResponseDelegate d = new GetResponseDelegate (GetAsyncResponse);
			DelegateAsyncResult result = new DelegateAsyncResult ();
			AsyncContext userContext = new AsyncContext (d, result, callback, state);
			result.AsyncResult = d.BeginInvoke (new AsyncCallback (DelegateAsyncResult.Callback), userContext);
			return result;
		}
Ejemplo n.º 4
0
			public AsyncContext (Delegate @delegate, DelegateAsyncResult delegateAsyncResult, AsyncCallback asyncCallback, object userState) {
				AsyncDelegate = @delegate;
				AsyncCallback = asyncCallback;
				AsyncState = userState;
				DelegateAsyncResult = delegateAsyncResult;
			}
Ejemplo n.º 5
0
 internal static void SetException(DelegateAsyncResult inst, Exception exception)
 {
     inst.completed = true;
     inst.exception = exception;
 }
Ejemplo n.º 6
0
 internal static void SetResult(DelegateAsyncResult inst, object result)
 {
     inst.completed = true;
     inst.result = result;
 }
Ejemplo n.º 7
0
 internal static void SetException(DelegateAsyncResult inst, Exception exception)
 {
     inst.completed = true;
     inst.exception = exception;
 }
Ejemplo n.º 8
0
 internal static void SetResult(DelegateAsyncResult inst, object result)
 {
     inst.completed = true;
     inst.result    = result;
 }