Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

AutoCorrectionMap for the RapidSpellDialog - RapidSpell WPF - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
TMulder
#1 Posted : Wednesday, January 19, 2011 7:11:01 PM
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?
Jim
#2 Posted : Wednesday, January 19, 2011 7:45:29 PM
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!


TMulder
#3 Posted : Wednesday, January 19, 2011 8:38:40 PM
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?
Jim
#4 Posted : Wednesday, January 19, 2011 8:47:26 PM
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!


Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.