Esempio n. 1
0
        internal static void ExecuteEvent(string database, EventCommand waitingevent )
        {
            var store = new ObjectStoreWrapper(database);

              foreach (var ge in _globaleventhandlers)
              {
            try
            {
              if (ge != null) ge(store, waitingevent);
            }
            catch (Exception ex)
            {
              Debug.WriteLine(ex.Message);
            }
              }

              Action<ObjectStoreWrapper, BSonDoc> method = FindEventHandler(waitingevent.Command.Deserialize());
              try
              {
            if (method != null)
              method(store, waitingevent.Command.Deserialize());
              }
              catch (Exception ex)
              {
            Debug.WriteLine(ex.Message);
              }
        }
Esempio n. 2
0
        internal static void ExecuteCommandEvent(string database, EventCommand waitingevent)
        {
            var store = new ObjectStoreWrapper(database);

              #region Execute inline global event handlers
              foreach (var ge in _globaleventhandlers)
              {
            try
            {
              if (ge != null) ge(store, waitingevent);
            }
            catch (Exception ex)
            {
              Debug.WriteLine(ex.Message);
            }
              }
              #endregion

              var command = waitingevent.Command.Deserialize();

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