Beispiel #1
0
        public void SearchButton()
        {
            foreach (string t in searchText.text.Split(' '))
            {
                if (t.Length == 0)
                {
                    continue;
                }

                SearchLog temp = new SearchLog()
                {
                    tag  = t,
                    time = DateTime.Now.ToString("MM") + "." + DateTime.Now.ToString("dd")
                };

                bool added = false;

                for (int i = 0; i < logs.Count; i++)
                {
                    SearchLog target = logs[i];

                    if (target.tag == temp.tag)
                    {
                        added       = true;
                        target.time = DateTime.Now.ToString("mm") + "." + DateTime.Now.ToString("dd");

                        break;
                    }
                }

                if (!added)
                {
                    logs.Add(temp);
                }
            }

            indicator.text = searchText.text;
            placeHolder.SetActive(searchText.text.Length == 0);
            Save();
            context.RefreshSearch();
            Close();
        }