Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Documents / SpellerError.cs / 1 / SpellerError.cs
//---------------------------------------------------------------------------- // // File: SpellerError.cs // // Description: A misspelled word in a TextBox or RichTextBox. // //--------------------------------------------------------------------------- namespace System.Windows.Controls { using System.Collections; using System.Collections.Generic; using System.Windows.Documents; using MS.Internal; ////// A misspelled word in a TextBox or RichTextBox. /// public class SpellingError { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors // Creates a new instance. internal SpellingError(Speller speller, ITextPointer start, ITextPointer end) { Invariant.Assert(start.CompareTo(end) < 0); _speller = speller; _start = start.GetFrozenPointer(LogicalDirection.Forward); _end = end.GetFrozenPointer(LogicalDirection.Backward); } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Replaces the spelling error text with a specificed correction. /// /// /// Text to replace the error. /// ////// This method repositions the caret to the position immediately /// following the corrected text. /// public void Correct(string correctedText) { if (correctedText == null) { correctedText = String.Empty; // Parity with TextBox.Text. } ITextRange range = new TextRange(_start, _end); range.Text = correctedText; } ////// Instructs the control to ignore this error and any duplicates for /// the remainder of its lifetime. /// public void IgnoreAll() { _speller.IgnoreAll(TextRangeBase.GetTextInternal(_start, _end)); } #endregion Public methods //------------------------------------------------------ // // Public Properties // //------------------------------------------------------ #region Public Properties ////// A list of suggested replaced for the misspelled text. /// ////// May be empty, meaning no suggestions are available. /// public IEnumerableSuggestions { get { IList suggestions = _speller.GetSuggestionsForError(this); for (int i=0; i /// Start position of the misspelled text. /// internal ITextPointer Start { get { return _start; } } /// /// End position of the misspelled text. /// internal ITextPointer End { get { return _end; } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //----------------------------------------------------- #region Private Fields // Speller associated with this error. private readonly Speller _speller; // Start position of the error text. private readonly ITextPointer _start; // End position of the error text. private readonly ITextPointer _end; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AsnEncodedData.cs
- SystemIcmpV6Statistics.cs
- CounterCreationDataCollection.cs
- DesignerAutoFormatCollection.cs
- AutomationPattern.cs
- CompensableActivity.cs
- FileVersion.cs
- InputLangChangeRequestEvent.cs
- VersionedStream.cs
- PersonalizableAttribute.cs
- EntityCommandCompilationException.cs
- SystemIcmpV4Statistics.cs
- ResXResourceWriter.cs
- FixedSOMSemanticBox.cs
- GridLengthConverter.cs
- SignedXml.cs
- PathGeometry.cs
- RMEnrollmentPage3.cs
- PhysicalFontFamily.cs
- StrongNameIdentityPermission.cs
- VirtualStackFrame.cs
- SafeViewOfFileHandle.cs
- CompilerInfo.cs
- ImageMapEventArgs.cs
- InstalledVoice.cs
- CompilerErrorCollection.cs
- ReceiveSecurityHeaderElementManager.cs
- AmbientValueAttribute.cs
- FullTextState.cs
- DataGridViewCellStateChangedEventArgs.cs
- AnnotationHelper.cs
- RepeaterItemCollection.cs
- ConsoleCancelEventArgs.cs
- VSWCFServiceContractGenerator.cs
- TrackingExtract.cs
- DataGridPagerStyle.cs
- FixedSOMImage.cs
- TypeElementCollection.cs
- webproxy.cs
- FragmentQueryKB.cs
- StoreContentChangedEventArgs.cs
- Transactions.cs
- GridViewCancelEditEventArgs.cs
- LassoHelper.cs
- TextPenaltyModule.cs
- DynamicValidatorEventArgs.cs
- ExtendedProtectionPolicyTypeConverter.cs
- Compilation.cs
- GeometryHitTestParameters.cs
- AppliesToBehaviorDecisionTable.cs
- ConfigurationProperty.cs
- XPathNavigatorKeyComparer.cs
- OleDbMetaDataFactory.cs
- HtmlControl.cs
- TraceSwitch.cs
- GlyphRunDrawing.cs
- CSharpCodeProvider.cs
- DependencyObjectPropertyDescriptor.cs
- SendSecurityHeaderElement.cs
- NativeCompoundFileAPIs.cs
- FileDialogCustomPlaces.cs
- StringSource.cs
- RegexCaptureCollection.cs
- SemanticAnalyzer.cs
- MeshGeometry3D.cs
- PageParserFilter.cs
- TdsParserSafeHandles.cs
- ParsedAttributeCollection.cs
- ValidationSummary.cs
- AssemblyInfo.cs
- BinaryWriter.cs
- ForwardPositionQuery.cs
- InvokeMemberBinder.cs
- TypeConverterMarkupExtension.cs
- LassoSelectionBehavior.cs
- TryLoadRunnableWorkflowCommand.cs
- EventWaitHandle.cs
- SqlRemoveConstantOrderBy.cs
- SqlMethodCallConverter.cs
- UrlMappingCollection.cs
- RawKeyboardInputReport.cs
- RegexRunner.cs
- TypeDescriptor.cs
- StorageRoot.cs
- Composition.cs
- ResourceType.cs
- Nullable.cs
- Parser.cs
- ObjectConverter.cs
- ExpressionBuilder.cs
- FixedDocument.cs
- HostSecurityManager.cs
- ReliableRequestSessionChannel.cs
- Rfc4050KeyFormatter.cs
- Tile.cs
- ImageSource.cs
- EnumValidator.cs
- Int16Animation.cs
- Color.cs
- ResourceManagerWrapper.cs