public void ShowProgress(IWin32Window owner, UrlContentRetreivalAsyncOperation asyncOperation) { // got past the delay interval, need to signup for events and show the dialog _asyncOperation = asyncOperation; _asyncOperation.Completed += new EventHandler(_asyncOperation_Completed); _asyncOperation.Cancelled += new EventHandler(_asyncOperation_Cancelled); _asyncOperation.Failed += new ThreadExceptionEventHandler(_asyncOperation_Failed); // show the dialog ShowDialog(owner); }
public void ShowProgress(IWin32Window owner, UrlContentRetreivalAsyncOperation asyncOperation) { // got past the delay interval, need to signup for events and show the dialog _asyncOperation = asyncOperation; _asyncOperation.Completed += new EventHandler(_asyncOperation_Completed); _asyncOperation.Cancelled += new EventHandler(_asyncOperation_Cancelled); _asyncOperation.Failed += new ThreadExceptionEventHandler(_asyncOperation_Failed); // show the dialog ShowDialog(owner); }
private static bool ExecuteWithProgress( IWin32Window dialogOwner, UrlContentRetreivalWithProgressDialog progressDialog, UrlContentRetreivalAsyncOperation asyncOperation, ContentSourceInfo contentSourceInfo) { try { // show the progress dialog using (progressDialog) { asyncOperation.Start(); progressDialog.ShowProgress(dialogOwner, asyncOperation); } // handle the result if (asyncOperation.Error != null) { ContentSourceManager.DisplayContentRetreivalError(dialogOwner, asyncOperation.Error, contentSourceInfo); return(false); } else if (asyncOperation.WasCancelled) { return(false); } else { return(true); } } catch (Exception ex) { Trace.Fail("Unexpected exception executing network operation for content source: " + ex.ToString()); return(false); } }
private static bool ExecuteWithProgress( IWin32Window dialogOwner, UrlContentRetreivalWithProgressDialog progressDialog, UrlContentRetreivalAsyncOperation asyncOperation, ContentSourceInfo contentSourceInfo) { try { // show the progress dialog using (progressDialog) { asyncOperation.Start(); progressDialog.ShowProgress(dialogOwner, asyncOperation); } // handle the result if (asyncOperation.Error != null) { ContentSourceManager.DisplayContentRetreivalError(dialogOwner, asyncOperation.Error, contentSourceInfo); return false; } else if (asyncOperation.WasCancelled) { return false; } else { return true; } } catch (Exception ex) { Trace.Fail("Unexpected exception executing network operation for content source: " + ex.ToString()); return false; } }