/// <summary> /// Callback after image is retrieved refreshes the grid with the new value /// </summary> /// <param name="r"></param> void ImageBitmapRetrieved(IAsyncResult r) { GetImageBitmapDelegate d = (r as AsyncResult).AsyncDelegate as GetImageBitmapDelegate; GetImageBitmapArgs args = d.EndInvoke(r); // end invoke and get the handle of the row that has been updated RefreshGridForImageValue(); if (DebugDetails) { ClientLog.Message("ImageBitmapRetrieved callback called for callId: " + args.callId); } }
/// <summary> /// Start async call to get image if not already in progress /// </summary> /// <param name="ci"></param> /// <param name="dr"></param> /// <param name="listSourceRowIndex"></param> /// <param name="fieldValue"></param> /// <param name="imageMx"></param> /// <param name="callId"></param> private void GetImageBitmapAsync(CellInfo ci, DataRowMx dr, int listSourceRowIndex, object fieldValue, ImageMx imageMx, int callId) { if (!imageMx.IsRetrievingValue) // start retrieve if not already started { //if (Debug) ClientLog.Message("Dispatching async callId: " + callId); imageMx.IsRetrievingValue = true; GetImageBitmapDelegate d = new GetImageBitmapDelegate(GetImageBitmap); d.BeginInvoke(ci, dr, listSourceRowIndex, fieldValue, imageMx, callId, new AsyncCallback(ImageBitmapRetrieved), null); return; } else { return; } }