public MacroEditor(MacrosManager parent, TableLayoutPanel pan = null) { this.parent = parent; this.pan = pan; InitializeComponent(); if (pan != null) { Data = parent.GetMacro((string)pan.Tag); if (Data == null) { throw new InvalidOperationException(); } //Debug.WriteLine(JsonConvert.SerializeObject(this.Data)); string[] ta = ((string)pan.Tag).Split('/'); STB1_box.Text = ta[1]; try { STB2_box.Text = Data["description"].Value <string>(); } catch (Exception err) { } try { STB4.RowCount = Data["actions"].ToList <JToken>().Count; STB4.RowStyles.Clear(); int noline = 0; foreach (JToken action in Data["actions"].ToList <JToken>()) { AddUiActionLine(action, noline); noline++; } } catch (Exception err) { } } else { Data = new JObject(); Data["description"] = null; Data["actions"] = new JArray(); STB4.RowCount = 0; STB4.RowStyles.Clear(); } }
private void gestionMacrosToolStripMenuItem_Click(object sender, EventArgs e) { MacrosManager.MacrosManager mc = new MacrosManager.MacrosManager(); mc.StartPosition = FormStartPosition.CenterScreen; mc.ShowDialog(); }
private void RG15_btn_Click(object sender, EventArgs e) { MacrosManager.MacrosManager mac = new MacrosManager.MacrosManager(this); mac.ShowDialog(); mac.Dispose(); }