Exemple #1
0
        public List <string> GetSequenceList()
        {
            List <Sequence> listOfSequences     = sequenceList.GetSequences();
            List <string>   listOfSequenceNames = new List <string>();

            foreach (Sequence sequence in listOfSequences)
            {
                listOfSequenceNames.Add(sequence.name);
            }

            return(listOfSequenceNames);
        }
        // Starts running the selected sequence in a new thread. Fails if another sequence
        // is already running.
        public void RunSequence(string sequenceName)
        {
            Sequence sequence = sequenceList.GetSequences().Find(x => x.name == sequenceName);

            if (sequence == null)
            {
                ErrorLogging.AddMessage(ErrorLogging.LoggingLevel.Error, "Sequence '" + sequenceName + "' not found.");
                return;
            }

            lock (sequenceLock)
            {
                if (sequenceIsRunning)
                {
                    ErrorLogging.AddMessage(ErrorLogging.LoggingLevel.Warning, "RunSequence() failed to run sequence '" + sequenceName + "', another sequence is already running.");
                    return;
                }
                else
                {
                    sequenceIsRunning = true;
                }
            }

            runningSequence = sequence;
            Thread oThread = new Thread(new ThreadStart(RunSequenceThread));

            // Start the thread
            oThread.Start();
        }