Example #1
0
 protected override void OnCustomCommand(int command)
 {
     if (command == ServiceCommands.ReadPendingMessages.GetHashCode())
     {
         foreach (Message m in Message.getPendingMessages())
         {
             LoggerCustomCommands cmd = m.Command;
             cmd.Execute(loggers[(int)cmd.stationID]);
             Message.Update(m.ID);
         }
     }
 }
        public bool stopLogger(int stationID)
        {
            LoggerCustomCommands cmd = new LoggerCustomCommands();

            cmd.stationID = stationID;
            cmd.command   = LoggerCommands.StopLogger;

            Message.Insert(cmd.Serialize(), null);

            ServiceController sc = new ServiceController("RecordingService");

            sc.ExecuteCommand(ServiceCommands.ReadPendingMessages.GetHashCode());
            return(true);
        }