示例#1
0
 public void GetSuggestionItem()
 {
     try
     {
         string key;
         int    i = Key.LastIndexOf(',');
         if (i < 0)
         {
             key = Key;
         }
         else
         {
             key = Key.Substring(i + 1);
         }
         var items = DerpTagDb.DerpTagSuggestion(key);
         if (!SuggestionLock)
         {
             SuggestionItems = items;
         }
         else
         {
             SuggestionLock = false;
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
示例#2
0
        public async Task Search()
        {
            ListViewIsRefreshing = true;
            CurrentKey           = string.Empty;
            foreach (string str in _tempKeys)
            {
                if (CurrentKey.Length == 0)
                {
                    CurrentKey = str;
                }
                else
                {
                    CurrentKey += ',' + str;
                }
            }

            bool res = await ExecuteLoadItemsCommand();


            if (res)
            {
                ListViewIsRefreshing = false;
                if (Images.Count > 0)
                {
                    foreach (string str in _tempKeys)
                    {
                        if (!str.StartsWith("-"))
                        {
                            var temp = await DerpTagDb.GetTagFromNameAsync(str);

                            if (temp == null)
                            {
                                await DerpTagDb.InsertTagAsync(new DerpTag(str));
                            }
                        }
                    }
                }
            }
        }