예제 #1
0
        public void AppendCommand_WD(string data)
        {
            string[] commands = data.Split(new string[1] { "#$#" }, StringSplitOptions.None);
            //baseURL + command + target + value + lastURL + csharp_command
            string baseURL = commands[0];
            string TextCommand = "WD."+commands[1];
            string Target = commands[2];
            string Value = commands[3];
            string lastURL = commands[4];
            string CSharpCommands = commands[5];

            if (!this.Command.Items.Contains(TextCommand))
                this.Command.Items.Add(TextCommand);
            Command_WD c = new Command_WD();
            c.TextCommand = TextCommand;
            c.baseURL = baseURL;
            c.lastURL = lastURL;
            c.Value = Value;
            string[] commands_splited = CSharpCommands.Split(new string[1] { "#@#" }, StringSplitOptions.RemoveEmptyEntries);
            string[] target_splited = Target.Split(new string[1] { "#@#" }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < commands_splited.Length; i++)
            {
                target_command_pair tc = new target_command_pair();
                tc.Target = target_splited[i];
                tc.CSharpCommand = commands_splited[i];
                c.target_command_list.Add(tc);
            }
            c.selectedTargetIndex = commands_splited.Length - 1;
            command_table.SetCommand(c);
            command_table.UpdateLastRow2Grid(metroCommandGrid);
        }
예제 #2
0
 private void InitValues()
 {
     metroCommandGrid.Rows.Clear();
     command_table.Clear();
     //object[] row = new object[5] { null, "WD.Run", default_browser, "", null };
     Command_WD c = new Command_WD();
     c.TextCommand = "WD.Run";
     target_command_pair pair = new target_command_pair();
     pair.Target = default_browser;
     c.baseURL = default_browser;
     pair.CSharpCommand = "";
     c.target_command_list.Add(pair);
     c.Value = "";
     command_table.SetCommand(c,0);
     command_table.UpdateLastRow2Grid(metroCommandGrid);
 }