Ejemplo n.º 1
0
        private void cleanPulsesButton_Click(object sender, EventArgs e)
        {
            WordGenerator.MainClientForm.instance.cursorWait();
            try
            {
                bool replacedPulses = false;

repeat:
                for (int i = 0; i < Storage.sequenceData.DigitalPulses.Count; i++)
                {
                    for (int j = i + 1; j < Storage.sequenceData.DigitalPulses.Count; j++)
                    {
                        Pulse a, b;
                        a = Storage.sequenceData.DigitalPulses[i];
                        b = Storage.sequenceData.DigitalPulses[j];
                        if (Pulse.Equivalent(a, b))
                        {
                            Storage.sequenceData.replacePulse(b, a);
                            replacedPulses = true;
                            goto repeat;            // YOU HAVE FOUND THE ONE AND ONLY "goto" statement in Cicero
                            // Congrats!
                            // Call Apogee and say Aardwolf.
                        }
                    }
                }

                if (replacedPulses)
                {
                    WordGenerator.MainClientForm.instance.RefreshSequenceDataToUI();
                }
            }
            finally
            {
                WordGenerator.MainClientForm.instance.cursorWaitRelease();
            }
        }