internal static void PerformInternalCallback <T>(string callbackName, Callbacks.Type callbackType, T param1, IntPtr param2, IntPtr userData) { Logger.d("Entering internal callback for " + callbackName); Action <T, IntPtr> action; try { action = callbackType != Callbacks.Type.Permanent ? Callbacks.IntPtrToTempCallback <Action <T, IntPtr> >(userData) : Callbacks.IntPtrToPermanentCallback <Action <T, IntPtr> >(userData); } catch (Exception ex) { Logger.e("Error encountered converting " + callbackName + ". Smothering to avoid passing exception into Native: " + (object)ex); return; } Logger.d("Internal Callback converted to action"); if (action == null) { return; } try { action(param1, param2); } catch (Exception ex) { Logger.e("Error encountered executing " + callbackName + ". Smothering to avoid passing exception into Native: " + (object)ex); } }
internal static void PerformInternalCallback(string callbackName, Callbacks.Type callbackType, IntPtr response, IntPtr userData) { Logger.d("Entering internal callback for " + callbackName); Action <IntPtr> action = callbackType != Callbacks.Type.Permanent ? Callbacks.IntPtrToTempCallback <Action <IntPtr> >(userData) : Callbacks.IntPtrToPermanentCallback <Action <IntPtr> >(userData); if (action == null) { return; } try { action(response); } catch (Exception ex) { Logger.e("Error encountered executing " + callbackName + ". Smothering to avoid passing exception into Native: " + (object)ex); } }