Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / SpellerError.cs / 1305600 / 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
- SHA512.cs
- DataMemberAttribute.cs
- SubclassTypeValidator.cs
- TextOnlyOutput.cs
- RemotingConfiguration.cs
- HealthMonitoringSection.cs
- RelationshipEnd.cs
- MenuItemStyle.cs
- XmlSchemaSubstitutionGroup.cs
- HttpCachePolicy.cs
- HtmlHead.cs
- SystemNetworkInterface.cs
- PagerSettings.cs
- ThreadPool.cs
- ContactManager.cs
- QueryTreeBuilder.cs
- CheckedListBox.cs
- Matrix3D.cs
- MsmqInputChannelListenerBase.cs
- VirtualizingStackPanel.cs
- BitmapSource.cs
- DesignerView.xaml.cs
- CommonXSendMessage.cs
- WindowsFont.cs
- TdsParser.cs
- AnyAllSearchOperator.cs
- WebPartTracker.cs
- HtmlTernaryTree.cs
- JsonUriDataContract.cs
- DeleteStoreRequest.cs
- SchemaContext.cs
- GradientStop.cs
- BookmarkScope.cs
- StrongTypingException.cs
- PagesChangedEventArgs.cs
- XamlReader.cs
- VScrollBar.cs
- ExtenderProvidedPropertyAttribute.cs
- AssemblyNameProxy.cs
- PTConverter.cs
- Empty.cs
- WorkflowOperationErrorHandler.cs
- EndpointReference.cs
- CodeCatchClause.cs
- ServiceDiscoveryElement.cs
- XmlSchemaDatatype.cs
- StatusStrip.cs
- EdmValidator.cs
- DynamicObjectAccessor.cs
- UInt32.cs
- DocumentEventArgs.cs
- OleDbReferenceCollection.cs
- IPHostEntry.cs
- XmlSerializer.cs
- ControlCachePolicy.cs
- PeerReferralPolicy.cs
- PolyLineSegmentFigureLogic.cs
- RealProxy.cs
- Vector3DValueSerializer.cs
- RtfToXamlReader.cs
- PseudoWebRequest.cs
- ProcessHostFactoryHelper.cs
- SafeCoTaskMem.cs
- AllMembershipCondition.cs
- ConnectionStringSettingsCollection.cs
- DataException.cs
- GeometryDrawing.cs
- DocumentApplication.cs
- SettingsProperty.cs
- TrackingParticipant.cs
- RegexGroupCollection.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- ServicePoint.cs
- PeerInvitationResponse.cs
- XmlNodeChangedEventArgs.cs
- MembershipAdapter.cs
- StandardTransformFactory.cs
- TextUtf8RawTextWriter.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- DispatcherFrame.cs
- MediaContext.cs
- MenuAdapter.cs
- AlternationConverter.cs
- TableItemPattern.cs
- OAVariantLib.cs
- GiveFeedbackEventArgs.cs
- QueuePathEditor.cs
- SBCSCodePageEncoding.cs
- CompositeKey.cs
- TTSVoice.cs
- NetTcpBindingCollectionElement.cs
- EntitySetBaseCollection.cs
- OraclePermissionAttribute.cs
- LambdaCompiler.cs
- PreviewKeyDownEventArgs.cs
- CatalogPartDesigner.cs
- Function.cs
- CollectionViewGroupInternal.cs
- HttpClientProtocol.cs
- TextBoxBase.cs