Ejemplo n.º 1
0
        /// <summary>
        /// Adds a query to history.
        /// </summary>
        /// <param name="query"></param>
        public virtual void AddQueryToHistory(string query)
        {
            if (query == null || query.Length == 0)
            {
                return;
            }
            bool isPresentInHistory = false;

            foreach (string item in QueryHistory)
            {
                if (string.Compare(item, query, !FindOptions.MatchCase) == 0)
                {
                    isPresentInHistory = true;
                    break;
                }
            }


            if (!isPresentInHistory)
            {
                QueryHistory.AddItem(query);
            }
        }