/// <summary> /// Used to run the Event Mapper. /// </summary> /// <param name="eventType">Event to act on.</param> /// <param name="param">Parameter to match.</param> /// <param name="paramValue">Value of parameter to match.</param> /// <param name="command">Command to execute when event occurs.</param> public MappedEvent(MappingEvent eventType, string param, string paramValue, string command) : this(eventType, command) { _matchParam = true; _param = param; _paramValue = paramValue; }
/// <summary> /// Used to run the Event Mapper. /// </summary> /// <param name="eventType">Event to act on.</param> /// <param name="command">Command to execute when event occurs.</param> public MappedEvent(MappingEvent eventType, string command) { _matchParam = false; _eventType = eventType; _param = String.Empty; _paramValue = String.Empty; _command = command; }
private static void MapEvent(MappingEvent theEvent, bool async) { if (_inConfiguration) return; string eventName = Enum.GetName(typeof (MappingEvent), theEvent); IrssLog.Debug("Mappable event: {0}", eventName); if (Config.Events.Count == 0) { IrssLog.Debug("No event mappings in current configuration"); return; } foreach (MappedEvent mappedEvent in Config.Events) { if (mappedEvent.EventType == theEvent) { if (String.IsNullOrEmpty(mappedEvent.Command)) { IrssLog.Warn("Event found ({0}) with no command set", eventName); } else { try { IrssLog.Info("Event mapped: {0}, {1}", eventName, mappedEvent.Command); ProcessCommand(mappedEvent.Command, async); } catch (Exception ex) { IrssLog.Error(ex); } } } } }
/// <summary> /// Used to run the Event Mapper. /// </summary> /// <param name="eventType">Event to act on.</param> /// <param name="command">Command to execute when event occurs.</param> /// <param name="description">Description for this event/Command association.</param> public MappedEvent(MappingEvent eventType, string command, string description = "") { _eventType = eventType; _description = description; _command = command; }
/// <summary> /// Used to run the Event Mapper. /// </summary> /// <param name="eventType">Event to act on.</param> /// <param name="command">Command to execute when event occurs.</param> public MappedEvent(MappingEvent eventType, string command) { _eventType = eventType; _command = command; }