当前位置: 首页>>代码示例>>C#>>正文


C# QueryNode.Add方法代码示例

本文整理汇总了C#中QueryNode.Add方法的典型用法代码示例。如果您正苦于以下问题:C# QueryNode.Add方法的具体用法?C# QueryNode.Add怎么用?C# QueryNode.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueryNode的用法示例。


在下文中一共展示了QueryNode.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: QueryNumericalInput

        /// <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);
                }
            }
        }
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:70,代码来源:QueryTextInput.cs

示例2: QueryDomNodeProperty

        /// <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);
        }
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:14,代码来源:DomNodeQueryRoot.cs

示例3: QueryStringInput

        /// <summary>
        /// Constructor</summary>
        /// <param name="parentNode">Parent QueryNode</param>
        /// <param name="stringQueryOptions">String search types</param>
        public QueryStringInput(QueryNode parentNode, StringQuery stringQueryOptions)
        {
            m_textInput = 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 (stringQueryOptions != StringQuery.None)
            {
                QueryOptionItem newOptionItem;

                // "regular expression"
                if ((stringQueryOptions & StringQuery.RegularExpression) != 0)
                {
                    newOptionItem = this.AddOptionItem("matches the regular expression", (UInt64)StringQuery.RegularExpression);
                    m_textInput = newOptionItem.AddStringSearchTextInput(m_textInput);
                }

                // "contains"
                if ((stringQueryOptions & StringQuery.Contains) != 0)
                {
                    newOptionItem = this.AddOptionItem("contains", (UInt64)StringQuery.Contains);
                    m_textInput = newOptionItem.AddStringSearchTextInput(m_textInput);
                }

                // "matches"
                if ((stringQueryOptions & StringQuery.Matches) != 0)
                {
                    newOptionItem = this.AddOptionItem("is", (UInt64)StringQuery.Matches);
                    m_textInput = newOptionItem.AddStringSearchTextInput(m_textInput);
                }

                // "begins with"
                if ((stringQueryOptions & StringQuery.BeginsWith) != 0)
                {
                    newOptionItem = this.AddOptionItem("begins with", (UInt64)StringQuery.BeginsWith);
                    m_textInput = newOptionItem.AddStringSearchTextInput(m_textInput);
                }

                // "ends with"
                if ((stringQueryOptions & StringQuery.EndsWith) != 0)
                {
                    newOptionItem = this.AddOptionItem("ends with", (UInt64)StringQuery.EndsWith);
                    m_textInput = newOptionItem.AddStringSearchTextInput(m_textInput);
                }
            }
        }
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:60,代码来源:QueryTextInput.cs


注:本文中的QueryNode.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。