示例#1
0
        public IEnumerable <SearchItem> GetElements()
        {
            if (string.IsNullOrEmpty(m_SearchText) || m_QueryEngine == null)
            {
                return(m_Items);
            }
            var query = m_QueryEngine.Parse(m_SearchText);

            if (!query.valid)
            {
                return(m_Items);
            }
            return(query.Apply(Enumerable.Range(0, m_Items.Count), false).Select(i => m_Items[i]));
        }
示例#2
0
        private void UpdateGraphView()
        {
            var query = m_QueryEngine.Parse(m_QueryInput, m_QueryHandlerFactory);

            if (!query.valid && !string.IsNullOrEmpty(m_QueryInput))
            {
                foreach (var error in query.errors)
                {
                    Debug.LogWarning(error.reason);
                }
                return;
            }

            ((QueryGraphView)graphView).Reload(query.evaluationGraph);
        }