protected virtual void OnDictionaryCreated(DictionaryCreatedEventArgs args) { if (DictionaryCreated != null) { DictionaryCreated(this, args); } }
/// <summary> /// Initializes static default and custom dictionaries for the first time they are accessed in the application. /// </summary> private void EnsureDictionaries() { if (DefaultDictionary == null) { lock (lockObject) { if (DefaultDictionary == null) { SpellCheckerISpellDictionary result = CreateDefaultDictionaryCore(); SetupDefaultDictionary(result); DictionaryCreatedEventArgs args = new DictionaryCreatedEventArgs(result, false); OnDictionaryCreated(args); DefaultDictionary = args.Dictionary as SpellCheckerISpellDictionary ?? result; } } } if (CustomDictionary == null) { lock (lockObject) { if (CustomDictionary == null) { SpellCheckerCustomDictionary result = CreateCustomDictionaryCore(); SetupCustomDictionary(result); DictionaryCreatedEventArgs args = new DictionaryCreatedEventArgs(result, true); OnDictionaryCreated(args); CustomDictionary = args.Dictionary as SpellCheckerCustomDictionary ?? result; } } } }