private static String tryGetVarName(String type, Int64 val) { string retVal = String.Empty; try { switch (type) { case "[script]": retVal = "\"script_" + scriptreader.Items[val].Name + "\""; break; case "[local_variable]": retVal = "\":local" + val.ToString() + "\""; break; case "[quick_string]": retVal = "\"" + StaticDataHolder.FindQuickString((Int32)val) + "\""; break; case "#register": retVal = "reg" + val.ToString(); break; default: retVal = StaticDataHolder.FindVarName(type, (Int32)val); break; } } catch (IndexOutOfRangeException ex) {//will just return the String.Empty } return(retVal); }
public ScriptForm() { this.WindowState = FormWindowState.Maximized; InitializeComponent(); StaticDataHolder.LoadAll(); //MessageBox.Show("Error loading xml configurations:\n" + ex.Message); LoadScripts(); //after vars/constants/ops LoadTriggers(); //after scripts (for call_script) lb_ti_once.Text = String.Format("(only once = {0})", StaticDataHolder.Header_Triggers.KeyValue("ti_once").ToString()); }