Exemple #1
0
        public void LoadCommands()
        {
            //load all commands
            _automationCommands = TypeMethods.GenerateAutomationCommands(AContainer).Where(x => x.Command.CommandName != "SequenceCommand").ToList();

            //instantiate and populate display icons for commands
            _uiImages = UIImage.UIImageList(_automationCommands);

            var groupedCommands = _automationCommands.GroupBy(f => f.DisplayGroup);

            tvCommands.Nodes.Clear();
            foreach (var cmd in groupedCommands)
            {
                TreeNode newGroup = new TreeNode(cmd.Key);

                foreach (var subcmd in cmd)
                {
                    TreeNode subNode = new TreeNode(subcmd.ShortName);
                    subNode.ToolTipText = subcmd.Description;
                    newGroup.Nodes.Add(subNode);
                }

                tvCommands.Nodes.Add(newGroup);
            }

            tvCommands.Sort();

            _tvCommandsCopy = new TreeView();
            _tvCommandsCopy.ShowNodeToolTips = true;
            CopyTreeView(tvCommands, _tvCommandsCopy);
            txtCommandSearch.Text = _txtCommandWatermark;
        }
        private void LoadCommands(frmScriptBuilder scriptBuilder)
        {
            //load all commands
            scriptBuilder._automationCommands = TypeMethods.GenerateAutomationCommands(AContainer);

            //instantiate and populate display icons for commands
            scriptBuilder._uiImages = UIImage.UIImageList(scriptBuilder._automationCommands);

            var groupedCommands = scriptBuilder._automationCommands.Where(x => x.Command.CommandName != "BrokenCodeCommentCommand")
                                  .GroupBy(f => f.DisplayGroup);

            scriptBuilder.tvCommands.Nodes.Clear();
            foreach (var cmd in groupedCommands)
            {
                TreeNode newGroup = new TreeNode(cmd.Key);

                foreach (var subcmd in cmd)
                {
                    TreeNode subNode = new TreeNode(subcmd.ShortName);
                    subNode.ToolTipText = subcmd.Description;
                    newGroup.Nodes.Add(subNode);
                }

                scriptBuilder.tvCommands.Nodes.Add(newGroup);
            }

            scriptBuilder.tvCommands.Sort();

            scriptBuilder._tvCommandsCopy = new TreeView();
            scriptBuilder._tvCommandsCopy.ShowNodeToolTips = true;
            CopyTreeView(scriptBuilder.tvCommands, scriptBuilder._tvCommandsCopy);
            scriptBuilder.txtCommandSearch.Text = _txtCommandWatermark;
        }
        private void LoadCommands()
        {
            //load all commands
            var commandClasses = TypeMethods.GenerateCommandTypes(AContainer);

            _uiImages           = new ImageList();
            _automationCommands = TypeMethods.GenerateAutomationCommands(_uiImages, commandClasses);

            var groupedCommands = _automationCommands.Where(x => x.Command.CommandName != "BrokenCodeCommentCommand")
                                  .GroupBy(f => f.DisplayGroup);

            tvCommands.Nodes.Clear();
            foreach (var cmd in groupedCommands)
            {
                TreeNode newGroup = new TreeNode(cmd.Key);

                foreach (var subcmd in cmd)
                {
                    TreeNode subNode = new TreeNode(subcmd.ShortName);
                    subNode.ToolTipText = subcmd.Description;
                    newGroup.Nodes.Add(subNode);
                }

                tvCommands.Nodes.Add(newGroup);
            }

            tvCommands.Sort();

            _tvCommandsCopy = new TreeView();
            _tvCommandsCopy.ShowNodeToolTips = true;
            CopyTreeView(tvCommands, _tvCommandsCopy);
            txtCommandSearch.Text = _txtCommandWatermark;
        }