Ejemplo n.º 1
0
        public static object dosearch(RubyModule /*!*/ self, [NotNull] RubyArray /*!*/ arSourcesR, [NotNull] String /*!*/ from, [NotNull] String /*!*/ strParams,
                                      [NotNull] bool /*!*/ bSearchSyncChanges, [NotNull] int /*!*/ nProgressStep, String /*!*/ strCallback, String /*!*/ strCallbackParams)
        {
            object res = null;

            try
            {
                SyncThread.stopSync();

                if (strCallback != null && strCallback.Length > 0)
                {
                    SyncThread.getSyncEngine().getNotify().setSearchNotification(strCallback, strCallbackParams);
                }

                Vector <String> arSources = RhoRuby.makeVectorStringFromArray(arSourcesR);

                SyncThread.getInstance().addQueueCommand(new SyncThread.SyncSearchCommand(from, strParams, arSources, bSearchSyncChanges, nProgressStep));

                res = SyncThread.getInstance().getRetValue();
            }
            catch (Exception ex)
            {
                Exception rubyEx = self.Context.CurrentException;
                if (rubyEx == null)
                {
                    rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
                }
                LOG.ERROR("dosearch", ex);
                throw rubyEx;
            }

            return(res);
        }
Ejemplo n.º 2
0
        public static void set_syncserver(RubyModule /*!*/ self, [NotNull] String /*!*/ syncserver)
        {
            try
            {
                SyncThread.stopSync();
                SyncThread.getSyncEngine().setSyncServer(syncserver);

                if (syncserver != null && syncserver.length() > 0)
                {
                    SyncThread.getInstance().start(SyncThread.epLow);
                    if (ClientRegister.getInstance() != null)
                    {
                        ClientRegister.getInstance().startUp();
                    }
                }
            }
            catch (Exception ex)
            {
                Exception rubyEx = self.Context.CurrentException;
                if (rubyEx == null)
                {
                    rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
                }
                LOG.ERROR("set_syncserver", ex);
                throw rubyEx;
            }
        }
Ejemplo n.º 3
0
 public static bool is_syncing(RubyModule /*!*/ self)
 {
     try
     {
         return(SyncThread.getSyncEngine().isSyncing());
     }
     catch (Exception ex)
     {
         LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "is_syncing");
         return(false);
     }
 }
Ejemplo n.º 4
0
        public static void set_syncserver(RubyModule /*!*/ self, [NotNull] String /*!*/ syncserver)
        {
            SyncThread.stopSync();
            SyncThread.getSyncEngine().setSyncServer(syncserver);

            if (syncserver != null && syncserver.length() > 0)
            {
                SyncThread.getInstance().start(SyncThread.epLow);
                if (ClientRegister.getInstance() != null)
                {
                    ClientRegister.getInstance().startUp();
                }
            }
        }
Ejemplo n.º 5
0
        public static object dosearch(RubyModule /*!*/ self, [NotNull] RubyArray /*!*/ arSourcesR, [NotNull] String /*!*/ from, [NotNull] String /*!*/ strParams,
                                      [NotNull] bool /*!*/ bSearchSyncChanges, [NotNull] int /*!*/ nProgressStep, String /*!*/ strCallback, String /*!*/ strCallbackParams)
        {
            SyncThread.stopSync();

            if (strCallback != null && strCallback.Length > 0)
            {
                SyncThread.getSyncEngine().getNotify().setSearchNotification(strCallback, strCallbackParams);
            }

            Vector <String> arSources = RhoRuby.makeVectorStringFromArray(arSourcesR);

            SyncThread.getInstance().addQueueCommand(new SyncThread.SyncSearchCommand(from, strParams, arSources, bSearchSyncChanges, nProgressStep));

            return(SyncThread.getInstance().getRetValue());
        }
Ejemplo n.º 6
0
 public static void add_objectnotify(RubyModule /*!*/ self, [NotNull] int /*!*/ nSrcID, [NotNull] string /*!*/ strObject)
 {
     try
     {
         SyncThread.getSyncEngine().getNotify().addObjectNotify(nSrcID, strObject);
     }
     catch (Exception ex)
     {
         Exception rubyEx = self.Context.CurrentException;
         if (rubyEx == null)
         {
             rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
         }
         LOG.ERROR("add_objectnotify", ex);
         throw rubyEx;
     }
 }
Ejemplo n.º 7
0
 public static void enable_status_popup(RubyModule /*!*/ self, bool /*!*/ bEnable)
 {
     try
     {
         SyncThread.getSyncEngine().getNotify().enableStatusPopup(bEnable);
     }
     catch (Exception ex)
     {
         Exception rubyEx = self.Context.CurrentException;
         if (rubyEx == null)
         {
             rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
         }
         LOG.ERROR("enable_status_popup", ex);
         throw rubyEx;
     }
 }
Ejemplo n.º 8
0
 public static void clean_objectnotify(RubyModule /*!*/ self)
 {
     try
     {
         SyncThread.getSyncEngine().getNotify().cleanObjectNotifications();
     }
     catch (Exception ex)
     {
         Exception rubyEx = self.Context.CurrentException;
         if (rubyEx == null)
         {
             rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
         }
         LOG.ERROR("clean_objectnotify", ex);
         throw rubyEx;
     }
 }
Ejemplo n.º 9
0
 public static void set_threaded_mode(RubyModule /*!*/ self, [NotNull] bool /*!*/ bThreadMode)
 {
     try
     {
         SyncThread.getInstance().setNonThreadedMode(!bThreadMode);
         SyncThread.getSyncEngine().setNonThreadedMode(!bThreadMode);
     }
     catch (Exception ex)
     {
         Exception rubyEx = self.Context.CurrentException;
         if (rubyEx == null)
         {
             rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
         }
         LOG.ERROR("set_threaded_mode", ex);
         throw rubyEx;
     }
 }
Ejemplo n.º 10
0
 public static void set_notification(RubyModule /*!*/ self, [NotNull] int /*!*/ nSrcID, [NotNull] String /*!*/ url, string /*!*/ callback_param)
 {
     try
     {
         SyncThread.getSyncEngine().getNotify().setSyncNotification(nSrcID,
                                                                    new SyncNotify.SyncNotification(url, callback_param != null ? callback_param : "", nSrcID != -1));
     }
     catch (Exception ex)
     {
         Exception rubyEx = self.Context.CurrentException;
         if (rubyEx == null)
         {
             rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
         }
         LOG.ERROR("set_notification", ex);
         throw rubyEx;
     }
 }
Ejemplo n.º 11
0
 public static void logout(RubyModule /*!*/ self)
 {
     try
     {
         SyncThread.stopSync();
         SyncThread.getSyncEngine().logout_int();
     }
     catch (Exception ex)
     {
         Exception rubyEx = self.Context.CurrentException;
         if (rubyEx == null)
         {
             rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
         }
         LOG.ERROR("logout", ex);
         throw rubyEx;
     }
 }
Ejemplo n.º 12
0
        public static int logged_in(RubyModule /*!*/ self)
        {
            int res = 0;

            try
            {
                res = SyncThread.getSyncEngine().isLoggedIn() ? 1 : 0;
            }
            catch (Exception ex)
            {
                Exception rubyEx = self.Context.CurrentException;
                if (rubyEx == null)
                {
                    rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
                }
                LOG.ERROR("logged_in", ex);
                throw rubyEx;
            }

            return(res);
        }
Ejemplo n.º 13
0
 public static void logout(RubyModule /*!*/ self)
 {
     SyncThread.stopSync();
     SyncThread.getSyncEngine().stopSyncByUser();
     SyncThread.getSyncEngine().logout();
 }
Ejemplo n.º 14
0
 public static void set_threaded_mode(RubyModule /*!*/ self, [NotNull] bool /*!*/ bThreadMode)
 {
     SyncThread.getInstance().setNonThreadedMode(!bThreadMode);
     SyncThread.getSyncEngine().setNonThreadedMode(!bThreadMode);
 }
Ejemplo n.º 15
0
 public static void enable_status_popup(RubyModule /*!*/ self, bool /*!*/ bEnable)
 {
     SyncThread.getSyncEngine().getNotify().enableStatusPopup(bEnable);
 }
Ejemplo n.º 16
0
 public static void set_notification(RubyModule /*!*/ self, [NotNull] int /*!*/ nSrcID, [NotNull] String /*!*/ url, string /*!*/ callback_param)
 {
     SyncThread.getSyncEngine().getNotify().setSyncNotification(nSrcID,
                                                                new SyncNotify.SyncNotification(url, callback_param != null ? callback_param : "", nSrcID != -1));
 }
Ejemplo n.º 17
0
 public static void clean_objectnotify(RubyModule /*!*/ self)
 {
     SyncThread.getSyncEngine().getNotify().cleanObjectNotifications();
 }
Ejemplo n.º 18
0
 public static int logged_in(RubyModule /*!*/ self)
 {
     return(SyncThread.getSyncEngine().isLoggedIn() ? 1 : 0);
 }
Ejemplo n.º 19
0
 public static void add_objectnotify(RubyModule /*!*/ self, [NotNull] int /*!*/ nSrcID, [NotNull] string /*!*/ strObject)
 {
     SyncThread.getSyncEngine().getNotify().addObjectNotify(nSrcID, strObject);
 }