Example #1
0
 public void AddWord(IntellisenseItem word, string group)
 {
     foreach (List<IntellisenseItem> list in Enumerable.Select<string, List<IntellisenseItem>>((IEnumerable<string>) new List<string>(this.IgnoreCase ? WordMatcher.GetSubWord(word.FilterValue.ToLower()) : WordMatcher.GetSubWord(word.FilterValue))
       {
     group
       }, new Func<string, List<IntellisenseItem>>(this.LookupOrAdd)))
       {
     if (Monitor.TryEnter((object) list))
     {
       try
       {
     if (!Enumerable.Contains<IntellisenseItem>((IEnumerable<IntellisenseItem>) list, word, (IEqualityComparer<IntellisenseItem>) this.intellisenseItemComparer))
       list.Add(word);
       }
       finally
       {
     Monitor.Exit((object) list);
       }
     }
       }
 }
Example #2
0
 public void RemoveWord(IntellisenseItem word)
 {
     foreach (List<IntellisenseItem> list in Enumerable.Select<string, List<IntellisenseItem>>(Enumerable.Where<string>(WordMatcher.GetSubWord(word.FilterValue), (Func<string, bool>) (item => this.wordTree.ContainsKey(item))), (Func<string, List<IntellisenseItem>>) (item => this.wordTree[item])))
       {
     if (Monitor.TryEnter((object) list))
     {
       try
       {
     if (list.Contains(word))
       list.Remove(word);
       }
       finally
       {
     Monitor.Exit((object) list);
       }
     }
       }
 }