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

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

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

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

            searchNameOrParam.AddOptionItem("whose name", 0).AddDomNodeNameQuery(true);
            searchNameOrParam.AddOptionItem("with a parameter", 0).AddDomNodePropertyQuery();
            m_rootNode.AddSeparator();
            m_rootNode.RegisterSearchButtonPress(m_rootNode.AddButton("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);
        }