private void RemoveObjectsInvolvingState(string stateName)
        {
            List <Instruction> temp = new List <Instruction>();

            // Remove related instructions
            foreach (Instruction instruction in Instructions)
            {
                if (instruction.CurrentState == stateName || instruction.NextState == stateName)
                {
                    temp.Add(instruction);
                }
            }

            foreach (Instruction instruction in temp)
            {
                Instructions.Remove(instruction);
            }

            // Remove related final states
            if (FinalStates.Contains(stateName))
            {
                FinalStates.Remove(stateName);
            }

            // Remove related initial state
            RemoveInitialStateInvolvingState(stateName);
        }
示例#2
0
        public void RemoveState(ail.net.parser.FsaState xi_state)
        {
            ail.net.framework.Assert.NonNullReference(xi_state, "xi_state");
            ail.net.framework.Assert.Condition(States.Contains(xi_state.Id), "States.Contains(xi_state.Id)");

            FinalStates.Remove(xi_state.Id);
            States.Remove(xi_state.Id);
        }
 public bool RemoveFinalState(string stateName)
 {
     if (FinalStates.Contains(stateName))
     {
         FinalStates.Remove(stateName);
         return(true);
     }
     return(false);
 }
示例#4
0
 private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (listBox6.SelectedIndex >= 0)
     {
         try
         {
             FinalStates.Remove(new State(listBox6.SelectedItem.ToString()));
             listBox5.Items.Add(listBox6.SelectedItem);
             listBox6.Items.Remove(listBox6.SelectedItem);
         }
         catch (Exception exception)
         {
             ConsoleWriter.Failure(exception.Message);
         }
     }
 }