public void copy(SControl s) { List <Step> temp = this.steps; Action free = () => { temp.ForEach((item) => { if (item.image != null) { item.image.Dispose(); } item.events.Clear(); }); }; if (temp.Count > 0) { (new Thread(new ThreadStart(free))).Start(); } this.steps = s.steps; onChange(); }
//Display test case private void dispTC(SControl s) { indices.sIndex = 1; toEnable.ForEach((item) => { item.Enabled = true; }); // Enable list of controls steps.copy(s); // Deallocates unused space and assigns s to steps save.Enabled = true; }
// Revert one step back public int revert(SControl steps) { int stepNum = inputs.Peek().stepNum; switch (inputs.Peek().type) { case modified.bitmap: revertBmp(steps); break; case modified.events: revertEvents(steps); break; case modified.both: revertStep(steps); break; } ; Pop(); return(stepNum); }
//Revert a modify bitmap uInput (not currently implemented) void revertBmp(SControl steps) { }
void revertStep(SControl steps) { steps.insert(inputs.Peek().stepNum, new Step(inputs.Peek().step)); }
void revertEvents(SControl steps) { steps.modEvent(inputs.Peek().stepNum, inputs.Peek().step.events); }