Example #1
0
 /// <summary>
 /// Constructor</summary>
 /// <param name="parentNode">Parent node to receive child</param>
 /// <param name="numericalQueryOptions">Bitfield defining which numerical search types can be selected</param>
 /// <param name="isReplacePattern">Whether or not this match should be used in a subsequent replace operation</param>
 public QueryPropertyValueAsNumberInput(QueryNode parentNode, NumericalQuery numericalQueryOptions, bool isReplacePattern) :
     base(parentNode, numericalQueryOptions) { m_isReplacePattern = isReplacePattern; }
Example #2
0
 /// <summary>
 /// Constructor</summary>
 /// <param name="parentNode">Node to receive child</param>
 /// <param name="numericalQueryOptions">Bitfield defining which numerical search types can be selected</param>
 /// <param name="isReplacePattern">Whether or not this match should be used in a subsequent replace operation</param>
 public QueryPropertyValueAsNumberInput(QueryNode parentNode, NumericalQuery numericalQueryOptions, bool isReplacePattern) :
     base(parentNode, numericalQueryOptions)
 {
     m_isReplacePattern = isReplacePattern;
 }
        /// <summary>
        /// Constructor</summary>
        /// <param name="parentNode">Parent QueryNode</param>
        /// <param name="numericalQueryOptions">Numerical search types</param>
        public QueryNumericalInput(QueryNode parentNode, NumericalQuery numericalQueryOptions)
        {
            m_textInput1 = null;
            m_textInput2 = null;

            parentNode.Add(this);

            // get root node
            QueryNode nodeAbove = parentNode;

            while (nodeAbove.Parent != null)
            {
                nodeAbove = nodeAbove.Parent as QueryNode;
            }

            // register 'option changed' event to root node
            QueryRoot rootNode = nodeAbove as QueryRoot;

            if (rootNode != null)
            {
                rootNode.RegisterQueryOption(this);
            }

            if (numericalQueryOptions != NumericalQuery.None)
            {
                QueryOptionItem newOptionItem;

                // "equals"
                if ((numericalQueryOptions & NumericalQuery.Equals) != 0)
                {
                    newOptionItem = this.AddOptionItem("equals", (UInt64)NumericalQuery.Equals);
                    m_textInput1  = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "lesser than"
                if ((numericalQueryOptions & NumericalQuery.Lesser) != 0)
                {
                    newOptionItem = this.AddOptionItem("is less than", (UInt64)NumericalQuery.Lesser);
                    m_textInput1  = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "lesser than or equal to"
                if ((numericalQueryOptions & NumericalQuery.LesserEqual) != 0)
                {
                    newOptionItem = this.AddOptionItem("is lesser or equal to", (UInt64)NumericalQuery.LesserEqual);
                    m_textInput1  = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "greater than or equal"
                if ((numericalQueryOptions & NumericalQuery.GreaterEqual) != 0)
                {
                    newOptionItem = this.AddOptionItem("is greater or equal to", (UInt64)NumericalQuery.GreaterEqual);
                    m_textInput1  = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "greater than"
                if ((numericalQueryOptions & NumericalQuery.Greater) != 0)
                {
                    newOptionItem = this.AddOptionItem("is greater than", (UInt64)NumericalQuery.Greater);
                    m_textInput1  = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "between"
                if ((numericalQueryOptions & NumericalQuery.Between) != 0)
                {
                    newOptionItem = this.AddOptionItem("is between", (UInt64)NumericalQuery.Between);
                    m_textInput1  = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                    newOptionItem.AddLabel("and");
                    m_textInput2 = newOptionItem.AddNumericalSearchTextInput(m_textInput2);
                }
            }
        }
Example #4
0
        /// <summary>
        /// Constructor</summary>
        /// <param name="parentNode">Parent QueryNode</param>
        /// <param name="numericalQueryOptions">Numerical search types</param>
        public QueryNumericalInput(QueryNode parentNode, NumericalQuery numericalQueryOptions)
        {
            m_textInput1 = null;
            m_textInput2 = null;

            parentNode.Add(this);

            // get root node
            QueryNode nodeAbove = parentNode;
            while (nodeAbove.Parent != null)
                nodeAbove = nodeAbove.Parent as QueryNode;

            // register 'option changed' event to root node
            QueryRoot rootNode = nodeAbove as QueryRoot;
            if (rootNode != null)
                rootNode.RegisterQueryOption(this);

            if (numericalQueryOptions != NumericalQuery.None)
            {
                QueryOptionItem newOptionItem;

                // "equals"
                if ((numericalQueryOptions & NumericalQuery.Equals) != 0)
                {
                    newOptionItem = this.AddOptionItem("equals", (UInt64)NumericalQuery.Equals);
                    m_textInput1 = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "lesser than"
                if ((numericalQueryOptions & NumericalQuery.Lesser) != 0)
                {
                    newOptionItem = this.AddOptionItem("is less than", (UInt64)NumericalQuery.Lesser);
                    m_textInput1 = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "lesser than or equal to"
                if ((numericalQueryOptions & NumericalQuery.LesserEqual) != 0)
                {
                    newOptionItem = this.AddOptionItem("is lesser or equal to", (UInt64)NumericalQuery.LesserEqual);
                    m_textInput1 = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "greater than or equal"
                if ((numericalQueryOptions & NumericalQuery.GreaterEqual) != 0)
                {
                    newOptionItem = this.AddOptionItem("is greater or equal to", (UInt64)NumericalQuery.GreaterEqual);
                    m_textInput1 = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "greater than"
                if ((numericalQueryOptions & NumericalQuery.Greater) != 0)
                {
                    newOptionItem = this.AddOptionItem("is greater than", (UInt64)NumericalQuery.Greater);
                    m_textInput1 = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                }

                // "between"
                if ((numericalQueryOptions & NumericalQuery.Between) != 0)
                {
                    newOptionItem = this.AddOptionItem("is between", (UInt64)NumericalQuery.Between);
                    m_textInput1 = newOptionItem.AddNumericalSearchTextInput(m_textInput1);
                    newOptionItem.AddLabel("and");
                    m_textInput2 = newOptionItem.AddNumericalSearchTextInput(m_textInput2);
                }
            }
        }
Example #5
0
 /// <summary>
 /// Adds a QueryOption that is the root of a QueryTree that provides text input for numerical queries</summary>
 /// <param name="parentNode">QueryNode to receive child</param>
 /// <param name="numericalQueryOptions">Bitfield defining which numerical search types can be selected</param>
 /// <returns>Instance of the new QueryNumericalInput child node</returns>
 public static QueryOption AddNumericalQuery(this QueryNode parentNode, NumericalQuery numericalQueryOptions)
 {
     return(new QueryNumericalInput(parentNode, numericalQueryOptions));
 }
Example #6
0
 /// <summary>
 /// Adds a QueryOption that is the root of a QueryTree that provides text input for numerical queries</summary>
 /// <param name="parentNode">QueryNode to receive child</param>
 /// <param name="numericalQueryOptions">Bitfield defining which numerical search types can be selected</param>
 /// <returns>Instance of the new QueryNumericalInput child node</returns>
 public static QueryOption AddNumericalQuery(this QueryNode parentNode, NumericalQuery numericalQueryOptions)
 {
     return new QueryNumericalInput(parentNode, numericalQueryOptions);
 }