/
Default.aspx.cs
37 lines (31 loc) · 1.29 KB
/
Default.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#region #usings
using DevExpress.XtraSpellChecker;
using System;
#endregion #usings
namespace WebApplication1 {
public partial class Default : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
}
protected void ASPxSpellChecker1_CheckedElementResolve(object sender, DevExpress.Web.ControlResolveEventArgs e) {
e.ResolvedControl = ASPxMemo2;
}
#region #SaveCustomDictionary
protected void ASPxButton2_Click(object sender, EventArgs e) {
SpellCheckerCachedCustomDictionary dic = Session[ASPxSpellChecker1.Dictionaries[1].CacheKey] as SpellCheckerCachedCustomDictionary;
MyCustomDictionary dictionary = new MyCustomDictionary();
for (int i = 0; i < dic.WordCount; i++)
dictionary.AddWord(dic[i]);
dictionary.SaveAs(dic.DictionaryPath);
}
}
public class MyCustomDictionary : SpellCheckerCustomDictionary {
public MyCustomDictionary() : base() { }
public MyCustomDictionary(string dictionaryPath, System.Globalization.CultureInfo culture) : base(dictionaryPath, culture) { }
public override bool Loaded {
get {
return true;
}
}
}
#endregion #SaveCustomDictionary
}