示例#1
0
        private void CreateTestWindow_Load(object sender, System.EventArgs e)
        {
            InterceptedFunctionDB db = InterceptedFunctionDB.GetInstance("functions.xml");

            foreach (InterceptedFunction f in db.Functions)
            {
                this.functionNameComboBox.Items.Add(f.Name);
            }

            // add error codes to the error code drop down
            IEnumerator enumerator = ErrorCodeDB.GetInstance().GetAllValues().GetEnumerator();

            while (enumerator.MoveNext())
            {
                this.errorCodeComboBox.Items.Add(enumerator.Current);
            }

            if (function != null)
            {
                this.functionNameComboBox.SelectedItem = function.Name;
                this.functionGroupLabel.Text           = function.Category;
                this.returnTypeLabel.Text = function.ReturnType;

                string modifier = null;
                foreach (string s in function.Modifiers)
                {
                    if (modifier != null)
                    {
                        modifier += ", ";
                    }

                    modifier += s;
                }

                this.modifiersLabel.Text = modifier;

                // fill in the parameters
                foreach (InterceptedFunctionParameter param in function.Parameters)
                {
                    ListViewItem item = new ListViewItem(param.Name);
                    item.SubItems.Add(param.Type);
                    item.SubItems.Add(param.TestValue);

                    paramListView.Items.Add(item);
                }
            }

            hasLoaded = true;
        }
示例#2
0
        private void functionNameComboBox_SelectedValueChanged(object sender, System.EventArgs e)
        {
            if (hasLoaded)
            {
                InterceptedFunctionDB db = InterceptedFunctionDB.GetInstance("functions.xml");
                InterceptedFunction   f  = db.GetFunctionByName(functionNameComboBox.SelectedItem.ToString());
                if (f != null)
                {
                    this.functionGroupLabel.Text = f.Category;
                    this.returnTypeLabel.Text    = f.ReturnType;

                    string modifier = null;
                    foreach (string s in f.Modifiers)
                    {
                        if (modifier != null)
                        {
                            modifier += ", ";
                        }

                        modifier += s;
                    }

                    this.modifiersLabel.Text = modifier;

                    // fill in the parameters
                    paramListView.Items.Clear();
                    foreach (InterceptedFunctionParameter param in f.Parameters)
                    {
                        ListViewItem item = new ListViewItem(param.Name);
                        item.SubItems.Add(param.Type);
                        param.TestValue = IgnoreParamString;
                        item.SubItems.Add(param.TestValue);

                        paramListView.Items.Add(item);
                    }
                }
                function = f;
            }
        }
示例#3
0
        public LogFilterTreeView()
        {
            this.CheckBoxes         = true;
            this.ImageIndex         = -1;
            this.Name               = "filterTreeView";
            this.SelectedImageIndex = -1;
            this.Size               = new System.Drawing.Size(424, 360);
            this.eventHandler       = new System.Windows.Forms.TreeViewEventHandler(this.filterTreeView_AfterCheck);
            this.AfterCheck        += eventHandler;

            filteredOutFunctions = new ArrayList();

            InterceptedFunctionDB db = InterceptedFunctionDB.GetInstance("functions.xml");

            registryOperations = db.GetFunctionCategoryArray("REGISTRY");
            libraryOperations  = db.GetFunctionCategoryArray("LIBRARY");
            processOperations  = db.GetFunctionCategoryArray("PROCESS");
            networkOperations  = db.GetFunctionCategoryArray("NETWORK");
            fileOperations     = db.GetFunctionCategoryArray("FILE");
            memoryOperations   = db.GetFunctionCategoryArray("MEMORY");

            regNode  = new TreeNode("Registry Operations");
            libNode  = new TreeNode("Library Operations");
            procNode = new TreeNode("Process Operations");
            netNode  = new TreeNode("Network Operations");
            fileNode = new TreeNode("File Operations");
            memNode  = new TreeNode("Memory Operations");

            regNode.Checked  = true;
            libNode.Checked  = true;
            procNode.Checked = true;
            netNode.Checked  = true;
            fileNode.Checked = true;
            memNode.Checked  = true;

            this.Nodes.Add(fileNode);
            this.Nodes.Add(libNode);
            this.Nodes.Add(memNode);
            this.Nodes.Add(netNode);
            this.Nodes.Add(procNode);
            this.Nodes.Add(regNode);

            foreach (InterceptedFunction f in registryOperations)
            {
                TreeNode node = new TreeNode(f.Name);
                node.Checked = true;
                regNode.Nodes.Add(node);
            }

            foreach (InterceptedFunction f in libraryOperations)
            {
                TreeNode node = new TreeNode(f.Name);
                node.Checked = true;
                libNode.Nodes.Add(node);
            }

            foreach (InterceptedFunction f in processOperations)
            {
                TreeNode node = new TreeNode(f.Name);
                node.Checked = true;
                procNode.Nodes.Add(node);
            }

            foreach (InterceptedFunction f in networkOperations)
            {
                TreeNode node = new TreeNode(f.Name);
                node.Checked = true;
                netNode.Nodes.Add(node);
            }

            foreach (InterceptedFunction f in fileOperations)
            {
                TreeNode node = new TreeNode(f.Name);
                node.Checked = true;
                fileNode.Nodes.Add(node);
            }

            foreach (InterceptedFunction f in memoryOperations)
            {
                TreeNode node = new TreeNode(f.Name);
                node.Checked = true;
                memNode.Nodes.Add(node);
            }
        }