private static DataSet RunThread2(string command, object[] parms, drGeneric_String_String gi, int?timeout = null) { // Create the delegate. AsynchDataSet2 caller = new AsynchDataSet2(GetDataSet); // Initiate the asychronous call. IAsyncResult result = caller.BeginInvoke(command, parms, gi, timeout, null, null); // Wait for the WaitHandle to become signaled. result.AsyncWaitHandle.WaitOne(); // Call EndInvoke to retrieve the results. DataSet dResult = caller.EndInvoke(result); // Close the wait handle. result.AsyncWaitHandle.Close(); caller = null; result = null; return(dResult); }
private static DataSet RunThread2(string command, object[] parms, drGeneric_String_String gi, int? timeout = null) { // Create the delegate. AsynchDataSet2 caller = new AsynchDataSet2(GetDataSet); // Initiate the asychronous call. IAsyncResult result = caller.BeginInvoke(command, parms, gi, timeout, null, null); // Wait for the WaitHandle to become signaled. result.AsyncWaitHandle.WaitOne(); // Call EndInvoke to retrieve the results. DataSet dResult = caller.EndInvoke(result); // Close the wait handle. result.AsyncWaitHandle.Close(); caller = null; result = null; return dResult; }