Beispiel #1
0
        private void Button_Reset_Click(object sender, EventArgs e)
        {
            this.Word         = "";
            this.CurrentState = StateTable["q0"];
            this.FinalState   = null;

            if (PictureBox_Logo.Visible)
            {
                PictureBox_Logo.Visible = false;
            }

            if (LinkLabel_RecomendationText.Visible)
            {
                LinkLabel_RecomendationText.Visible = false;
            }

            Button_Append0.Enabled = true;
            Button_Append1.Enabled = true;
            Button_Append2.Enabled = true;

            Label_BotStatus.Text       = "Trabajando";
            PictureBox_BotStatus.Image = Image.FromFile("../../../resources/mainform/processing.png");

            UpdateWindowByCurrentState();
        }
Beispiel #2
0
        private void Button_Append2_Click(object sender, EventArgs e)
        {
            this.Word += '2';

            if (Word.Length < 3)
            {
                CurrentState = GetNextState('2');
                UpdateWindowByCurrentState();
            }
            else
            {
                FinalState = FinalStateTable[Word];
                UpdateWindowByFinalState();
            }
        }
Beispiel #3
0
        public void InitializeFinalStatesTable()
        {
            FinalStateTable = new Dictionary <string, FinalStateValue>();
            string id, text, link, logo;

            foreach (string value in File.ReadLines("../../../resources/final-state-values.txt"))
            {
                // value string format: id|text|link|logo

                id   = value.Split('|')[0];
                text = value.Split('|')[1];
                link = value.Split('|')[2];
                logo = value.Split('|')[3];

                FinalStateTable[id] = new FinalStateValue(text, link, logo);
            }
        }