예제 #1
0
 public void DeleteWordItem(int ID)
 {
     WordHistoryHelper.DeleteByID(ID);
     foreach (var item in WordHistoryCollection)
     {
         if (item.ID == ID)
         {
             WordHistoryCollection.Remove(item);
             return;
         }
     }
 }
예제 #2
0
 public void Add_WordHistory(WordHistoryModel model)
 {
     if (WordHistoryHelper.IsQueryHistoryAllowed & !IsDuplicated(model.Word))
     {
         int maxLength = (int)LeptonTextBlockControl.MaxLengthProperty.GetMetadata(typeof(LeptonTextBlockControl)).DefaultValue;
         if (model.Word.Length > maxLength)
         {
             model.Word = model.Word.Substring(0, maxLength);
         }
         WordHistoryCollection.Insert(0, WordHistoryHelper.Add(model));
     }
 }
 public void DeleteAllHistory()
 {
     WordHistoryHelper.DeleteAll();
     SearchSuggestionPageViewModel.Current.DeleteAllHistoryItem();
 }
예제 #4
0
 public void GetAll_WordHistory()
 {
     WordHistoryCollection.Clear();
     foreach (var item in ObservableCollectionHelper.GetObservableCollectionFromList(WordHistoryHelper.QueryAll()))
     {
         WordHistoryCollection.Add(item);
     }
 }