Ejemplo n.º 1
0
        private void btFindPath_Click(object sender, EventArgs e)
        {
            SetUIBlockState(block: true);
            tbOutput.AppendText($"PATH FROM {tbPathStart.Text} TO {tbPathFinish.Text}\r\n");
            string start  = tbPathStart.Text;
            string finish = tbPathFinish.Text;



            GraphControl gControl = new GraphControl();

            gControl.FindPathJson(start, finish, Indented: true);

            tbOutput.AppendText(gControl.FindPathJson(start, finish, Indented: true));


            ScrollToEnd();
            SetUIBlockState(block: false);
        }
Ejemplo n.º 2
0
        private void btPrintTree_Click(object sender, EventArgs e)
        {
            SetUIBlockState(block: true);
            try
            {
                GraphControl gControl = new GraphControl();

                var output = gControl.CreateTreeJson(gControl.converter.ConvertNametoID(tbTreeHead.Text.ToUpper()), StringToInt(tbDepth.Text), Indented: true);
                tbOutput.AppendText($"PRINTING A TREE STARTING FROM {tbTreeHead.Text.ToUpper()} WITH DUPLICATES\r\n");
                tbOutput.AppendText(output);
                tbOutput.AppendText("========================\r\n");



                ScrollToEnd();
            }
            catch (Exception ex)
            {
                tbOutput.AppendText($"\r\nException occured: {ex.Message}\r\n");
            }
            SetUIBlockState(block: false);
        }