Ejemplo n.º 1
0
        public static object dosync_source(RubyModule /*!*/ self, [NotNull] object /*!*/ srcID, bool /*!*/ show_status_popup)
        {
            int    nSrcID  = 0;
            String strName = "";

            if (srcID is long)
            {
                nSrcID = (int)(long)srcID;
            }
            else if (srcID is int)
            {
                nSrcID = (int)srcID;
            }
            else
            {
                strName = srcID.ToString();
            }

            SyncThread.getInstance().addQueueCommand(new SyncThread.SyncCommand(SyncThread.scSyncOne, strName, nSrcID, show_status_popup));
            return(SyncThread.getInstance().getRetValue());
        }
Ejemplo n.º 2
0
        public static int set_pollinterval(RubyModule /*!*/ self, [NotNull] int /*!*/ nInterval)
        {
            int nOldInterval = 0;

            try
            {
                nOldInterval = SyncThread.getInstance().getPollInterval();
                SyncThread.getInstance().setPollInterval(nInterval);
            }
            catch (Exception ex)
            {
                Exception rubyEx = self.Context.CurrentException;
                if (rubyEx == null)
                {
                    rubyEx = RubyExceptionData.InitializeException(new RuntimeError(ex.Message.ToString()), ex.Message);
                }
                LOG.ERROR("set_pollinterval", ex);
                throw rubyEx;
            }

            return(nOldInterval);
        }
Ejemplo n.º 3
0
        public static object dosync_source(RubyModule /*!*/ self, [NotNull] object /*!*/ srcID)
        {
            object res = null;

            try
            {
                int    nSrcID  = 0;
                String strName = "";
                if (srcID is long)
                {
                    nSrcID = (int)(long)srcID;
                }
                else if (srcID is int)
                {
                    nSrcID = (int)srcID;
                }
                else
                {
                    strName = srcID.ToString();
                }

                SyncThread.getInstance().addQueueCommand(new SyncThread.SyncCommand(SyncThread.scSyncOne, strName, nSrcID, true));

                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("dosync_source", ex);
                throw rubyEx;
            }

            return(res);
        }
Ejemplo n.º 4
0
        public static object dosync(RubyModule /*!*/ self, bool /*!*/ show_status_popup)
        {
            object res = null;

            try
            {
                SyncThread.getInstance().addQueueCommand(new SyncThread.SyncCommand(SyncThread.scSyncAll, show_status_popup));

                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("dosync", ex);
                throw rubyEx;
            }

            return(res);
        }
Ejemplo n.º 5
0
 public static object dosync(RubyModule /*!*/ self, bool /*!*/ show_status_popup)
 {
     SyncThread.getInstance().addQueueCommand(new SyncThread.SyncCommand(SyncThread.scSyncAll, show_status_popup));
     return(SyncThread.getInstance().getRetValue());
 }
Ejemplo n.º 6
0
 public static object dosync(RubyModule /*!*/ self)
 {
     SyncThread.getInstance().addQueueCommand(new SyncThread.SyncCommand(SyncThread.scSyncAll, false));
     return(SyncThread.getInstance().getRetValue());
 }
Ejemplo n.º 7
0
 public static void set_threaded_mode(RubyModule /*!*/ self, [NotNull] bool /*!*/ bThreadMode)
 {
     SyncThread.getInstance().setNonThreadedMode(!bThreadMode);
     SyncThread.getSyncEngine().setNonThreadedMode(!bThreadMode);
 }
Ejemplo n.º 8
0
        public static object dosync_source(RubyModule /*!*/ self, params object[] args)
        {
            object res = null;

            try
            {
                int    nSrcID  = 0;
                String strName = "";

                if (args[0] is  long)
                {
                    nSrcID = (int)(long)args[0];
                }
                else if (args[0] is int)
                {
                    nSrcID = (int)args[0];
                }
                else
                {
                    strName = ((MutableString)args[0]).ToString();
                }

                /*if (srcID is long)
                 *  nSrcID = (int)(long)srcID;
                 * else if (srcID is int)
                 *  nSrcID = (int)srcID;
                 * else
                 *  strName = srcID.ToString();*/

                boolean bShowStatus  = true;
                String  query_params = "";
                if (args != null && args.Length > 1)
                {
                    if (args[1] is int)
                    {
                        bShowStatus = ((int)args[1]).Equals(1);
                    }
                    else if (args[1] is bool)
                    {
                        bShowStatus = (bool)args[1];
                    }
                    else
                    {
                        String str = ((MutableString)args[1]).ToString();
                        //bShowStatus = args[0].Equals(RubyConstant.QTRUE)||"true".equalsIgnoreCase(str);
                        bShowStatus = "true".equalsIgnoreCase(str);
                    }
                }

                if (args != null && args.Length > 2)
                {
                    query_params = ((MutableString)args[2]).ToString();
                }

                SyncThread.getInstance().addQueueCommand(new SyncThread.SyncCommand(SyncThread.scSyncOne, strName, nSrcID, bShowStatus, query_params));

                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("dosync_source", ex);
                throw rubyEx;
            }

            return(res);
        }