Esempio n. 1
0
        /// <summary>
        /// Constructor</summary>
        /// <param name="parentNode">Node to receive child</param>
        public QueryDomNodeProperty(QueryNode parentNode)
        {
            QueryTree.Add(parentNode, this);

            QueryTree.AddLabel(this, "whose name");
            new QueryPropertyNameInput(this, StringQuery.Matches, false);
            QueryTree.AddLabel(this, "and whose");
            QueryOption stringOrNumberOption = QueryTree.AddOption(this);

            new QueryPropertyValueAsStringInput(QueryTree.AddOptionItem(stringOrNumberOption, "string value", 0), StringQuery.All, true);
            new QueryPropertyValueAsNumberInput(QueryTree.AddOptionItem(stringOrNumberOption, "numerical value", 0), NumericalQuery.All, true);
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor</summary>
        public DomNodeSearchToolStrip() : base()
        {
            // Define query tree, which defines the layout of the search toolstrip GUI
            m_rootNode = new DomNodeQueryRoot();
            QueryTree.AddLabel(m_rootNode, "Find node(s)");

            // Add option to search DomNodes on either their name, or parameters
            QueryOption searchNameOrParam = QueryTree.AddOption(m_rootNode);

            QueryTreeDomNode.AddDomNodeNameQuery(QueryTree.AddOptionItem(searchNameOrParam, "whose name", 0), true);
            QueryTreeDomNode.AddDomNodePropertyQuery(QueryTree.AddOptionItem(searchNameOrParam, "with a parameter", 0));
            QueryTree.AddSeparator(m_rootNode);
            m_rootNode.RegisterSearchButtonPress(QueryTree.AddButton(m_rootNode, "Search"));

            // Entering text into the toolstrip will trigger a search, changing an option rebuilds the toolstrip GUI
            m_rootNode.SearchTextEntered += searchSubStrip_SearchTextEntered;
            m_rootNode.OptionChanged     += searchSubStrip_OptionsChanged;

            //
            // Build toolStrip GUI by retrieving toolstrip item list from tree, and adding
            // them to ToolStrip.Items
            //
            SuspendLayout();
            List <ToolStripItem> toolStripItems = new List <ToolStripItem>();

            m_rootNode.GetToolStripItems(toolStripItems);
            Items.AddRange(toolStripItems.ToArray());

            // Initialize ToolStrip
            Location  = new System.Drawing.Point(0, 0);
            Name      = "Event Sequence Document Search";
            Size      = new System.Drawing.Size(292, 25);
            TabIndex  = 0;
            Text      = "Event Sequence Document Search";
            GripStyle = ToolStripGripStyle.Hidden;

            // Done
            ResumeLayout(false);
        }