CapsHttpRequestCompletedArg rcha = (CapsHttpRequestCompletedArg) arg1;
try
{
if (rcha.getResult() == null || rcha.getError() != null)
{
callback.handleEvent(null, new AttachmentResourcesCallbackArg(false, null));
}
AttachmentResourcesMessage info = AttachmentResourcesMessage.FromOSD(rcha.getResult());
callback.handleEvent(null, new AttachmentResourcesCallbackArg(true, info));
}
catch (Exception ex)
{
JLogger.error("Failed fetching AttachmentResources" + Utils.getExceptionStackTraceAsString(ex));
callback.handleEvent(null, new AttachmentResourcesCallbackArg(false, null));
}
}
}
);
// request.OnComplete += delegate(CapsHttpClient client, OSD result, Exception error)
// {
// try
// {
// if (result == null || error != null)
// {
// callback(false, null);
// }
// AttachmentResourcesMessage info = AttachmentResourcesMessage.FromOSD(result);
// callback(true, info);
//
// }
// catch (Exception ex)
// {
// JLogger.error("Failed fetching AttachmentResources" + Utils.getExceptionStackTraceAsString(ex));
// callback(false, null);
// }
// };
request.BeginGetResponse(Client.settings.CAPS_TIMEOUT);
}
catch (Exception ex)
{
JLogger.error("Failed fetching AttachmentResources" + Utils.getExceptionStackTraceAsString(ex));
callback.handleEvent(null, new AttachmentResourcesCallbackArg(false, null));
}
}