protected override void SaveSettings() { int line = 0; if (this.rbLine1.Checked) { line = 1; } else if (this.rbLine2.Checked) { line = 2; } else if (this.rbLine3.Checked) { line = 3; } else if (this.rbLine4.Checked) { line = 4; } else if (this.rbLine5.Checked) { line = 5; } ComparativeOp operation = (ComparativeOp)Enum.ToObject(typeof(ComparativeOp), this.cbOperator.SelectedIndex); IoValue lineValue = IoValue.On; if (this.cbLineValue.SelectedIndex == 1) { lineValue = IoValue.Off; } this.action.UpdateSettings(line, operation, lineValue); }
public CheckInAction(string key, XmlElement properties) { this.key = key; if (properties.Name != "properties") { throw new ActionException("Can't create the action"); } foreach (XmlElement property in properties.ChildNodes) { switch (property.Name) { case "version": break; case "line": this.line = System.Convert.ToInt32(property.InnerText); break; case "operation": this.operation = (ComparativeOp)Enum.Parse(typeof(ComparativeOp), property.InnerText); break; case "lineValue": this.lineValue = (IoValue)Enum.Parse(typeof(IoValue), property.InnerText); break; default: throw new ProjectException("Error el crear la acción"); } } }
public CheckInAction(string key, int line, ComparativeOp operation, IoValue lineValue) { this.key = key; this.line = line; this.operation = operation; this.lineValue = lineValue; }
public void UpdateSettings(int line, ComparativeOp operation, IoValue lineValue) { this.line = line; this.operation = operation; this.lineValue = lineValue; }