static void UnmanagedCanReachAsyncFinish(IntPtr monitorPtr, IntPtr result, ref IntPtr errorPtr) { try { var monitor = (INetworkMonitor)Object.GetInstance(monitorPtr, Transfer.None); monitor.CanReachFinish(result); } catch (GErrorException ex) { GMarshal.PropagateError(errorPtr, ex.Error); } catch (Exception ex) { // FIXME: convert managed exception to GError ex.LogUnhandledException(); } }
static bool UnmanagedInit(IntPtr initablePtr, IntPtr cancellablePtr, ref IntPtr errorPtr) { try { var initable = (IInitable)Object.GetInstance(initablePtr, Transfer.None); var ret = initable.Init(cancellablePtr); return(ret); } catch (GErrorException ex) { GMarshal.PropagateError(errorPtr, ex.Error); } catch (Exception ex) { // FIXME: we should convert managed exception to GError ex.LogUnhandledException(); } return(false); }
static bool UnmanagedCanReach(IntPtr monitorPtr, IntPtr connectablePtr, IntPtr cancellablePtr, ref IntPtr errorPtr) { try { var monitor = (INetworkMonitor)Object.GetInstance(monitorPtr, Transfer.None); var ret = monitor.CanReach(connectablePtr, cancellablePtr); return(ret); } catch (GErrorException ex) { GMarshal.PropagateError(errorPtr, ex.Error); } catch (Exception ex) { // FIXME: convert managed exception to GError ex.LogUnhandledException(); } return(false); }