End Function
Public Overrides Function ReadAll(a As ArrayList) As Integer
'used by RapidSpell to read the words from the DB.
a.Clear()
a.AddRange(wordList)
Return a.Count
End Function 'ReadAll
Public Overrides Function IsValid() As Boolean
'return true if the word list exists and is valid.
'this should return false, if for example there was an sql exception at some point.
'return wordList != null;
'Defaulted to True for test.
Return True
End Function 'IsValid
Public Overrides Function AddWord(w As [String]) As Boolean
wordList.Add(w)
'The purpose of this is to store the word (in "w") in the
database.
Dim conn As New SqlConnection("server=(local)\NetSDK;database=....;Trusted_Connection=yes")
Dim command As New SqlCommand("INSERT INTO .............", conn)
conn.Open()
command.ExecuteNonQuery()
conn.Close()
Return True
End Function 'AddWord
End Class 'DBUserDictionary
End Namespace 'CustomUserDic
Using The DBUserDictionary Class
The new subclass of UserDictionary is then used like this:
If you are using the Javascript approach in version 4 up:
For Inline/As-you-type: modify the code in the page holding RapidSpellWInlineHelper, this is named “rswihelper.aspx” and is present in the Keyoti_RapidSpell_Web_Common folder under your web app.
Keyoti.RapidSpell.RapidSpellWInlineHelper rapidSpellWInlineHelper1 = new Keyoti.RapidSpell.RapidSpellWInlineHelper();
rapidSpellWInlineHelper1.CheckerEngine.SetUserDictionary( new DBUserDictionary ());
Form1.Controls.Add(rapidSpellWInlineHelper1);
For Dialog: modify the code in the page holding RapidSpellWeb (the popup), this is named “popup.aspx” and is present in the Keyoti_RapidSpell_Web_Common folder under your web app.
Keyoti.RapidSpell.RapidSpellWeb rapidSpellWeb1 = new Keyoti.RapidSpell.RapidSpellWeb();
rapidSpellWeb1.SSLFriendly = true;
rapidSpellWeb1.Width = new Unit(100, UnitType.Percentage);
RapidSpellWeb1.UserDictionary = new DBUserDictionary ();
Form1.Controls.Add(rapidSpellWeb1);
If you are using the Control based approach in all versions:
For RapidSpellWInline - modify the codebehind in the page holding RapidSpellWInlineHelper1
RapidSpellWInlineHelper1.CheckerEngine.SetUserDictionary( new DBUserDictionary ());
you must also set RapidSpellWInline.ShowAddItemAlways=true
For RapidSpellWebLauncher/RapidSpellWeb - modify the codebehind in the page holding RapidSpellWeb (the popup)
RapidSpellWeb1.UserDictionary = new DBUserDictionary ();