Esempio n. 1
0
        public FixList Add(string key, SpellingFix fix)
        {
            if (Items.TryGetValue(key, out ImmutableHashSet <SpellingFix>?fixes))
            {
                if (fixes.Contains(fix))
                {
                    return(this);
                }

                fixes = fixes.Add(fix);

                ImmutableDictionary <string, ImmutableHashSet <SpellingFix> > values = Items.SetItem(key, fixes);

                return(new FixList(values));
            }
            else
            {
                fixes = ImmutableHashSet.Create(SpellingFixComparer.InvariantCultureIgnoreCase, fix);

                ImmutableDictionary <string, ImmutableHashSet <SpellingFix> > dic = Items.Add(key, fixes);

                return(new FixList(dic));
            }
        }
Esempio n. 2
0
 public override int Compare(SpellingFix x, SpellingFix y)
 {
     return(StringComparer.CurrentCulture.Compare(x.Value, y.Value));
 }
Esempio n. 3
0
 public override int GetHashCode(SpellingFix obj)
 {
     return(WordList.DefaultComparer.GetHashCode(obj.Value));
 }
Esempio n. 4
0
 public override bool Equals(SpellingFix x, SpellingFix y)
 {
     return(WordList.DefaultComparer.Equals(x.Value, y.Value));
 }
Esempio n. 5
0
 public override int Compare(SpellingFix x, SpellingFix y)
 {
     return(WordList.DefaultComparer.Compare(x.Value, y.Value));
 }
Esempio n. 6
0
 public override int GetHashCode(SpellingFix obj)
 {
     return(StringComparer.CurrentCulture.GetHashCode(obj.Value));
 }
Esempio n. 7
0
 public override bool Equals(SpellingFix x, SpellingFix y)
 {
     return(StringComparer.CurrentCulture.Equals(x.Value, y.Value));
 }