This is a migrated thread and some comments may be shown as answers.

Writing RadDictionary back to .tdf when words are added?

4 Answers 151 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 12 Apr 2012, 07:00 PM
I have several dictionaries stored outside of the XAP file and I load the approriate one manually.   I did this in order to minimize the size of the xap.

To load the dictionary, I use the 'WebClient()' class and do the following in OpenReadCompletedEventHandler
System.IO.Stream st = e.Result;
dictionary = new RadDictionary();
dictionary.Load(st);
((DocumentSpellChecker)this.txtDesc.SpellChecker).AddDictionary(dictionary, CultureInfo.CurrentCulture);

The dictionary is loading properly, however adding to the dictionary only works for the session, which makes sense.  So my question is, how do I sync the .tdf file when the user selects "Add to dictionary".  I am able to capture the "DataChanged" event, so I guess in that event handler I just need to pass the dictionary ( or even better just the word) to my webservice and overwrite the existing .tdf.  How do I do that?

Also I realize this means all users will be editing the same .tdf, and that is not ideal, but right now it doesn't work at all and I just want to get it working.  I am still on the latest SL4 build.

4 Answers, 1 is accepted

Sort by
0
Andrew
Telerik team
answered on 17 Apr 2012, 03:09 PM
Hi Kjell,

DocumentSpelChecker uses custom dictionaries when you click the add or remove buttons. These custom dictionaries use isolated storage by default. You can alter the logic of those buttons the way you described, but we would recommend implementing the IWordDictionary interface instead. We have a class named RadIsolatedStorageCustomDictionary. You can download the source code for our controls and locate the file. You can alter the logic we have implemented to write to a file on the server instead in the IsolatedStorage and then using this class would cause everyone to use a common dictionary.
Please consider that approach and get back to us if you need additional assistance.

Kind regards,
Andrew
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Kjell
Top achievements
Rank 1
answered on 17 Apr 2012, 04:05 PM
Oops, I posted this in the wrong forum.. Should be in the SL forum, I'll create a new thread there, please delete this.
0
Desh
Top achievements
Rank 1
answered on 14 Jul 2017, 11:30 AM
Where can we find the source code of the controls as mentioned by you?
0
Tanya
Telerik team
answered on 19 Jul 2017, 08:47 AM
Hello Desh,

The source code of the controls could be found in your telerik.com account, under the Downloads section. Have in mind that it is distributed only with a developer license. Please, check the Download Product Files topic for more information on how to access the files.

Hope this is helpful.

Regards,
Tanya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
RichTextBox
Asked by
Kjell
Top achievements
Rank 1
Answers by
Andrew
Telerik team
Kjell
Top achievements
Rank 1
Desh
Top achievements
Rank 1
Tanya
Telerik team
Share this question
or