private bool JobCalled(TriggerReader reader) { double jobNumber = 0; if (reader.PeekVariable()) { jobNumber = reader.ReadVariable().Value.AsDouble(); } else if (reader.PeekNumber()) { jobNumber = reader.ReadNumber(); } double requiredJobNumber = reader.GetParameter <double>(0); if (reader.TryReadVariableTable(out VariableTable table, true)) { object[] args = reader.Parameters.Skip(1).ToArray(); for (int i = 0; i <= args.Length - 1; i++) { table.Add(i.ToString(), args[i]); } } bool result = false; if (jobNumber > 0 && jobNumber == requiredJobNumber) { result = reader.CurrentBlock.IndexOfTrigger(TriggerCategory.Effect, 115, reader.CurrentBlockIndex) == -1; } return(result); }
private bool CallJob(TriggerReader reader) { double jobNumber = 0; if (reader.PeekVariable()) { jobNumber = reader.ReadVariable().Value.AsDouble(); } else if (reader.PeekNumber()) { jobNumber = reader.ReadNumber(); } var args = reader.ReadValues().ToArray(); if (jobNumber > 0) { if (args == null || args.Length == 0) { reader.Page.Execute(100, jobNumber); } else { reader.Page.Execute(100, Enumerable.Concat(new object[] { jobNumber }, args).ToArray()); } } return(true); }
public static bool AndControlIs(TriggerReader reader) { if (reader.PeekNumber() == false) { return(false); } return(controls.ContainsKey(reader.ReadNumber())); }
public static bool MakeTriggeredControl(TriggerReader reader) { if (reader.PeekNumber() == false) { return(false); } double id = reader.ReadNumber(); reader.Page.SetVariable("triggered.control", id, true); return(true); }
public double ReadVariableOrNumber(TriggerReader reader, bool addIfNotExist = false) { double num = 0; if (reader.PeekVariable()) { string str = reader.ReadVariable(addIfNotExist).Value.ToString(); double.TryParse(str, out num); } else if (reader.PeekNumber()) { num = reader.ReadNumber(); } return(num); }
private bool SetVariableToNumberOrVariable(TriggerReader reader) { var var = reader.ReadVariable(true); if (reader.PeekVariable <double>()) { var.Value = reader.ReadVariable().Value.AsDouble(0d); } else if (reader.PeekNumber()) { var.Value = reader.ReadNumber(); } return(true); }
public static bool MakeControlInVisible(TriggerReader reader) { if (reader.PeekNumber() == false) { return(false); } Control control; bool containsControl = controls.TryGetValue(reader.ReadNumber(), out control); if (containsControl == false) { return(false); // Maybe throw exception for control not found } control.Visible = false; return(true); }
public static bool SetText(TriggerReader reader) { if (reader.PeekNumber() == false) { return(false); } Control control; bool containsControl = controls.TryGetValue(reader.ReadNumber(), out control); if (containsControl == false) { return(false); } control.Text = (reader.PeekString()) ? reader.ReadString() : ""; return(true); }
public static bool HideForm(TriggerReader reader) { if (reader.PeekNumber() == false) { return(false); } Control control; bool containsControl = ControlLib.controls.TryGetValue(reader.ReadNumber(), out control); if (containsControl == false) { return(false); // Maybe throw exception for control not found } if ((control is Form) == false) { return(false); } ((Form)control).Hide(); return(true); }