private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { if (listBox1.SelectedIndex == -1) { return; } this.SuspendDrawing(); File.SelectItem((InstanceMB)controller.Data.Records[listBox1.SelectedIndex]); ins = (InstanceMB)File.SelectedItem; tabControl1.Enabled = true; dirty.Push(true); Control cur = splitContainer1.ActiveControl; var tabIndex = tabControl1.SelectedIndex; tabControl1.SelectedIndex = -1; tabControl1.SelectedIndex = tabIndex; // yes, this is intentional! don't judge me splitContainer1.ActiveControl = cur; if (flagsEditor != null) { //flagsEditor.Instance = ins; } dirty.Push(false); this.ResumeDrawing(); }
private string GenTextForList(InstanceMB instance) { string obj_name = string.Empty; if (Enum.IsDefined(typeof(DefaultEnums.ObjectID_MB), instance.ObjectID)) { obj_name = (DefaultEnums.ObjectID_MB)instance.ObjectID + ""; } return($"ID {instance.ID} {(obj_name == string.Empty ? string.Empty : $" - {obj_name}")}");
public InstanceMBController(MainForm topform, InstanceMB item) : base(topform, item) { Data = item; AddMenu("Open editor", Menu_OpenEditor); }