Class SpellingError
Represents a misspelled word in a SfRichTextBoxAdv control.
Inheritance
System.Object
SpellingError
Namespace: Syncfusion.UI.Xaml.RichTextBoxAdv
Assembly: Syncfusion.SfRichTextBoxAdv.UWP.dll
Syntax
public class SpellingError : Object
Properties
Suggestions
Gets a list of suggested spelling replacements for the misspelled word.
Declaration
public IEnumerable<string> Suggestions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The collection of spelling suggestions for the misspelled word. |
Methods
Correct(String)
Replaces the misspelled word in a SfRichTextBoxAdv control with the specified correction text .
Declaration
public void Correct(string correctText)
Parameters
Type | Name | Description |
---|---|---|
System.String | correctText | The correction text to replace the misspelled word in a SfRichTextBoxAdv control. |
Examples
The following code example demonstrates how to correct a misspelled word in a SfRichTextBoxAdv control.
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv" xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:RichTextBoxAdv="clr-namespace:Syncfusion.Windows.Controls.RichTextBoxAdv;assembly=Syncfusion.SfRichTextBoxAdv.Wpf">
<RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
<!-- Enables spell checking functionality. -->
<RichTextBoxAdv:SpellChecker IsEnabled="True" IgnoreAlphaNumericWords="True" IgnoreURIs="True" IgnoreUppercaseWords="False">
<RichTextBoxAdv:SpellChecker.CustomDictionaries>
<!-- Defines the custom dictionaries for spell checking. -->
<System:String>../../Assets/Default.dic</System:String>
</RichTextBoxAdv:SpellChecker.CustomDictionaries>
</RichTextBoxAdv:SpellChecker>
</RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
</RichTextBoxAdv:SfRichTextBoxAdv>
public void CorrectSpellingError()
{
TextPosition textPosition = richTextBoxAdv.Document.GetTextPosition("0;0;20");
// Gets the spelling error at the specified text position.
Syncfusion.Windows.Controls.RichTextBoxAdv.SpellingError spellingError = richTextBoxAdv.GetSpellingError(textPosition);
if (spellingError != null && spellingError.Suggestions.Count() > 0)
// If a spelling error is found, corrects the misspelled word.
spellingError.Correct(spellingError.Suggestions.ElementAt(0));
}
Public Sub CorrectSpellingError()
Dim textPosition As TextPosition = richTextBoxAdv.Document.GetTextPosition("0;0;20")
' Gets the spelling error at the specified text position.
Dim spellingError As Syncfusion.Windows.Controls.RichTextBoxAdv.SpellingError = richTextBoxAdv.GetSpellingError(textPosition)
If spellingError IsNot Nothing AndAlso spellingError.Suggestions.Count() > 0 Then
' If a spelling error is found, corrects the misspelled word.
spellingError.Correct(spellingError.Suggestions.ElementAt(0))
End If
End Sub
IgnoreAll()
Ignores all the occurrences of a misspelled word in a SfRichTextBoxAdv control.
Declaration
public void IgnoreAll()
Examples
The following code example demonstrates how to ignore all occurrences of a misspelled word in a SfRichTextBoxAdv control.
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv" xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:RichTextBoxAdv="clr-namespace:Syncfusion.Windows.Controls.RichTextBoxAdv;assembly=Syncfusion.SfRichTextBoxAdv.Wpf">
<RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
<!-- Enables spell checking functionality. -->
<RichTextBoxAdv:SpellChecker IsEnabled="True" IgnoreAlphaNumericWords="True" IgnoreURIs="True" IgnoreUppercaseWords="False">
<RichTextBoxAdv:SpellChecker.CustomDictionaries>
<!-- Defines the custom dictionaries for spell checking. -->
<System:String>../../Assets/Default.dic</System:String>
</RichTextBoxAdv:SpellChecker.CustomDictionaries>
</RichTextBoxAdv:SpellChecker>
</RichTextBoxAdv:SfRichTextBoxAdv.SpellChecker>
</RichTextBoxAdv:SfRichTextBoxAdv>
public void IgnoreSpellingError()
{
TextPosition textPosition = richTextBoxAdv.Document.GetTextPosition("0;0;20");
// Gets the spelling error at the specified text position.
Syncfusion.Windows.Controls.RichTextBoxAdv.SpellingError spellingError = richTextBoxAdv.GetSpellingError(textPosition);
if (spellingError != null)
// If a spelling error is found, ignores all the occurrences of the misspelled word.
spellingError.IgnoreAll();
}
Public Sub IgnoreSpellingError()
Dim textPosition As TextPosition = richTextBoxAdv.Document.GetTextPosition("0;0;20")
' Gets the spelling error at the specified text position.
Dim spellingError As Syncfusion.Windows.Controls.RichTextBoxAdv.SpellingError = richTextBoxAdv.GetSpellingError(textPosition)
If spellingError IsNot Nothing Then
' If a spelling error is found, ignores all the occurrences of the misspelled word.
spellingError.IgnoreAll()
End If
End Sub