示例#1
0
        public void ProcessParameters(object sender, string[] args)
        {
            // The form has loaded, and initialization will have been be done.

            // Add the command-line arguments to our textbox, just to confirm that
            // it reached here.
            if (args != null && args.Length != 0)
            {
                string dot = args[0];
                args[0] = args[0].Substring(0, 1);
                switch (args[0])
                {
                case "0":
                    txtArgs.Text += DateTime.Now.ToString() + " Stop\r\n";
                    AlgorithmRunner.RunStop();
                    break;

                case "1":
                    AlgorithmRunner.RunCreateAdjacencyMatrix();
                    txtArgs.Text += DateTime.Now.ToString() + " RunCreateAdjacencyMatrix\r\n";
                    break;

                case "2":
                    InputHelper.Rooms = InputHelper.InitRooms();
                    AlgorithmRunner.RunPriority();
                    AlgorithmRunner.RunCalc();
                    txtArgs.Text += DateTime.Now.ToString() + " RunCalc\r\n";
                    break;

                case "3":
                    //Tạo ma trận kề
                    AlgorithmRunner.RunCreateAdjacencyMatrix();
                    txtArgs.Text += DateTime.Now.ToString() + " RunCreateAdjacencyMatrix\r\n";
                    //------------------------
                    //Xếp giờ, phòng
                    InputHelper.Rooms = InputHelper.InitRooms();
                    AlgorithmRunner.RunPriority();
                    AlgorithmRunner.RunCalc();
                    txtArgs.Text += DateTime.Now.ToString() + " RunCalc\r\n";
                    //---------------------------
                    InputHelper.Rooms = InputHelper.InitRooms();
                    AlgorithmRunner.RunSaveToDatabase();
                    txtArgs.Text += DateTime.Now.ToString() + " RunSaveToDatabase\r\n";
                    break;

                case "4":
                    //InputHelper.IgnoreStudents = InputHelper.InitIgnoreStudents();
                    AlgorithmRunner.RunHandmade();
                    txtArgs.Text += DateTime.Now.ToString() + " Handmade\r\n";
                    break;

                case "5":
                    InputHelper.Rooms = InputHelper.InitRooms();
                    AlgorithmRunner.RunDeleteDatabase(dot.Substring(1, dot.Length - 1));
                    txtArgs.Text += DateTime.Now.ToString() + " DeleteToDatabase\r\n";
                    break;

                case "6":
                    AlgorithmRunner.RunFixSubject();
                    txtArgs.Text += DateTime.Now.ToString() + " FixSubject\r\n";
                    break;

                default:
                    txtArgs.Text += DateTime.Now.ToString() + " Not Run Anything\r\n";
                    break;
                }
            }
            else
            {
                txtArgs.Text += DateTime.Now.ToString() + " Run No Args: Init()\r\n";
            }
        }