|
Rank: Member
Groups: Registered
Joined: 1/4/2011 Posts: 42
|
Hi,
Is there a AutoCorrectionMap for the RapidSpellDialog? If not, can we implement it somehow or can this be added?
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Yes, add a handler to the RapidSpellDialog.CreateUserInterfaceFormPresenter event, eg. Code: private void rapidSpellDialog1_CreateUserInterfaceFormPresenter(object s, Keyoti.RapidSpell.Wpf.Event.CreateUserInterfaceFormPresenterEventArgs e) { e.NewPresenter = new CustomPresenter(); }
Then add the new class Code: class CustomPresenter : Keyoti.RapidSpell.Wpf.RapidSpellGUIPresenter {
protected override void Resume() { base.Resume(); if(theBadWord.Word=="jimm"){ List<string> l = new List<string>(); l.Add("jim"); DialogView.SuggestionsListItems = l; ChangeWord(); } } }
Seems to work fine. Of course you'll want to change the lookup/correction from my name to items in the AutoCorrectionMap from AYT. Best Jim -your feedback is helpful to other users, thank you!Evaluation Downloads - http://keyoti.com/products-your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 1/4/2011 Posts: 42
|
Cool that did it. Man, you are fast in your responses.
I am trying to implement a word replacment for acroniems that our clients set up. For example tc stands for telephone conference. I could hijack the AutoCorrectionMap, however for that I need to enable AutoCorrectEnabled. Probably not all our clients would want the autocorrection enbaled. So I implemented this for RapidSpellAsYouType:
FoundSpellingError += SpellAsYouType_FoundSpellingError;
static void SpellAsYouType_FoundSpellingError(object s, FoundSpellingErrorEventArgs e) { if (e.BadWord.Word == "tc"){ e.Replacement = "Telephone Conference"; } }
Is that the best way of doing it?
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Yep, that's a perfectly fine way of doing it. Jim -your feedback is helpful to other users, thank you!Evaluation Downloads - http://keyoti.com/products-your feedback is helpful to other users, thank you!
|
|