Ejemplo n.º 1
0
 private static void SendToStartEvent(string name, Event instance, int targetServiceID)
 {
     if (EventDataContext.IsRunning(name))
     {
         if (instance.StartMessage != null && instance.StartMessage.Length > 0)
         {
             EventDataContext.BroadcastMessage(instance.StartMessage, targetServiceID);
         }
         AdminClientService.Instance.UpdateFeatureMatrix(instance.Feature, true, targetServiceID);
         AdminClientService.Instance.ProcessScript(instance.StartScript, targetServiceID);
         EventDataContext.RearrangeFirstIncomeMessage(targetServiceID);
     }
 }
Ejemplo n.º 2
0
        private static void EndEvent(string name)
        {
            Event @event;

            if (EventDataContext.runnings.TryGetValue(name, out @event))
            {
                if (@event.EndMessage != null && @event.EndMessage.Length > 0)
                {
                    EventDataContext.BroadcastMessage(@event.EndMessage, -1);
                }
                AdminClientService.Instance.UpdateFeatureMatrix(@event.Feature, false, -1);
                AdminClientService.Instance.ProcessScript(@event.EndScript, -1);
                EventDataContext.runnings.Remove(name);
                EventDataContext.RearrangeFirstIncomeMessage(-1);
            }
        }