private void btnActCopy_Click(object sender, RoutedEventArgs e) { MySelectableListItem sel = lstAct.CurrentlySelected; if (sel != null) { Action act = ((object[])sel.CustomData)[1] as Action; Parser parser = new Parser(new Scanner(act.ToSaveString(false))); Action clone = parser.parseOnlyAction(); MySelectableListItem item = addVisualAction(clone); lstAct.MoveItemBeforeItem(item, sel); lstAct.MoveItemBeforeItem(sel, item); } TabControl_SelectionChanged(null, null); }
private void btnCopy_Click(object sender, RoutedEventArgs e) { MySelectableListItem sel = lstTriggers.CurrentlySelected; if (sel != null) { Trigger trigger = ((object[])sel.CustomData)[1] as Trigger; string textTrig = trigger.ToSaveString(false); Trigger trig = Triggers.loadAndInsertAfter(textTrig, trigger); MySelectableListItem item = InsertTriggerIntoTheVisualList(trig); lstTriggers.MoveItemBeforeItem(item, sel); lstTriggers.MoveItemBeforeItem(sel, item); UnsavedChanges = true; } }