예제 #1
0
 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();
     }
 }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }