Пример #1
0
    internal static void ExecuteCommandEvent(string database, EventCommand waitingevent)
    {
      var store = new ObjectStoreWrapper(database);

      LogWriter.LogInformation("Executing waiting event", LogEntryType.Information);
      #region Execute inline global event handlers
      foreach (var ge in _globaleventhandlers)
      {
        try
        {
          if (ge != null) ge(store, waitingevent);
        }
        catch (Exception ex)
        {
          LogWriter.LogException(ex);
        }
      }
      #endregion

      var command = JObject.Parse(waitingevent.Command);

      var currenthandlers = ChechHandlers(command);
      if (currenthandlers != null)
        foreach (var hh in currenthandlers)
        {
          try
          {
            hh.HandleCommand(store, command);
          }
          catch (Exception ex)
          {
            LogWriter.LogException(ex);
          }
        }
    }
Пример #2
0
        internal static void ExecuteCommandEvent(string database, EventCommand waitingevent)
        {
            var store = new ObjectStoreWrapper(database);

            LogWriter.LogInformation("Executing waiting event", LogEntryType.Information);
            #region Execute inline global event handlers
            foreach (var ge in _globaleventhandlers)
            {
                try
                {
                    if (ge != null)
                    {
                        ge(store, waitingevent);
                    }
                }
                catch (Exception ex)
                {
                    LogWriter.LogException(ex);
                }
            }
            #endregion

            var command = JObject.Parse(waitingevent.Command);

            var currenthandlers = ChechHandlers(command);
            if (currenthandlers != null)
            {
                foreach (var hh in currenthandlers)
                {
                    try
                    {
                        hh.HandleCommand(store, command);
                    }
                    catch (Exception ex)
                    {
                        LogWriter.LogException(ex);
                    }
                }
            }
        }