public void MatchSensor(string Sensor) { foreach (var Cond in Conditions) { if (Cond.MatchSensor(Sensor)) { StateConditionTriggered?.Invoke(this, new ScriptStateEventArgs(Cond, Cond.NextState, false)); if (Cond.NextState.Trim() != "") { Deactivate(); StateCompleted?.Invoke(this, new ScriptStateEventArgs(Cond, Cond.NextState, false)); } } } }
private void Cond_TimerExpired(object sender, ScriptConditionEventArgs e) { ScriptCondition Cond = (ScriptCondition)sender; StateCompleted?.Invoke(this, new ScriptStateEventArgs(Cond, e.NextState, true)); }
public void CompleteState() { StateCompleted.Invoke(this); }