private void MoveTag(int from, Keys to) { int iMoveTo = -1; string tag = (string)lb [from].SelectedItem; if (to == Keys.Enter) { iMoveTo = 0; } if (to == Keys.F1) { iMoveTo = 1; } if (to == Keys.F2) { iMoveTo = 2; } if (to == Keys.F3) { iMoveTo = 3; } if (to == Keys.F4) { iMoveTo = 4; } if (to == Keys.F5) { iMoveTo = 5; } if (iMoveTo != -1) { MoveTag(tag, from, iMoveTo); } if (to == Keys.F9) { gSave_Click(new object(), new EventArgs()); } if (to == Keys.Escape) { HEvent he = undo.Undo(); if (he.tag == "") { return; } MoveTag(he.tag, he.to, he.from, he.ofs); for (int a = 0; a < lb.Length; a++) { lb[a].SelectedIndex = -1; } lb[he.from].SelectedIndex = he.ofs; lb[he.from].Select(); } }
public HEvent Undo() { if (al.Count == 0) { return(new HEvent( 0, "", 0, 0)); } HEvent ret = (HEvent) al[al.Count - 1]; al.RemoveAt(al.Count - 1); return(ret); }
public void Add(HEvent he) { al.Add(he); }