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
- ReachSerializerAsync.cs
- FixedPageAutomationPeer.cs
- ArrayList.cs
- DllNotFoundException.cs
- XPathParser.cs
- FloaterParagraph.cs
- AssociationTypeEmitter.cs
- SubpageParagraph.cs
- Pair.cs
- XPathNodeIterator.cs
- DataContractAttribute.cs
- NamedPipeConnectionPoolSettings.cs
- DesignerValidationSummaryAdapter.cs
- ConstructorExpr.cs
- WebBrowserNavigatedEventHandler.cs
- XmlKeywords.cs
- HScrollProperties.cs
- DebugControllerThread.cs
- RuntimeHelpers.cs
- DataGridColumn.cs
- ComplexPropertyEntry.cs
- TypeInitializationException.cs
- Int16AnimationBase.cs
- BezierSegment.cs
- Int32CollectionConverter.cs
- DelegateHelpers.cs
- AccessibleObject.cs
- EnumerableRowCollectionExtensions.cs
- Type.cs
- MethodBuilder.cs
- ObjectStorage.cs
- IisTraceWebEventProvider.cs
- GenericEnumConverter.cs
- ManifestSignatureInformation.cs
- ToolboxItemAttribute.cs
- MultitargetUtil.cs
- Attribute.cs
- DataGridViewCellValueEventArgs.cs
- ReadWriteSpinLock.cs
- RegionData.cs
- ButtonBase.cs
- PageOutputQuality.cs
- ResponseStream.cs
- ListBoxItem.cs
- SystemEvents.cs
- WebPartMovingEventArgs.cs
- SqlCommandSet.cs
- DataViewManagerListItemTypeDescriptor.cs
- TraceContextEventArgs.cs
- ConfigurationElementCollection.cs
- ClaimSet.cs
- CompModSwitches.cs
- _NestedMultipleAsyncResult.cs
- SubclassTypeValidatorAttribute.cs
- ValueType.cs
- DataServiceQueryContinuation.cs
- XmlSchemaGroup.cs
- PasswordTextNavigator.cs
- SafeUserTokenHandle.cs
- RtfToXamlLexer.cs
- CmsUtils.cs
- StorageBasedPackageProperties.cs
- DesignBindingPicker.cs
- C14NUtil.cs
- AcceleratedTokenProviderState.cs
- OleDbParameter.cs
- Token.cs
- ActivatableWorkflowsQueryResult.cs
- ProtocolImporter.cs
- TableItemStyle.cs
- WebControlParameterProxy.cs
- RetrieveVirtualItemEventArgs.cs
- ListViewSortEventArgs.cs
- HttpListenerException.cs
- CompositionDesigner.cs
- DataListCommandEventArgs.cs
- SelectionGlyph.cs
- ListControlConvertEventArgs.cs
- EntityDataSourceSelectingEventArgs.cs
- URLBuilder.cs
- ValueConversionAttribute.cs
- TimelineCollection.cs
- Splitter.cs
- SystemWebExtensionsSectionGroup.cs
- CachedFontFace.cs
- CustomCategoryAttribute.cs
- CodeTypeMemberCollection.cs
- PointLightBase.cs
- LinqDataSourceUpdateEventArgs.cs
- BitmapPalette.cs
- BufferedReadStream.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ColorContext.cs
- cookie.cs
- ListenerChannelContext.cs
- SmtpMail.cs
- OdbcCommandBuilder.cs
- FocusManager.cs
- ZipPackage.cs
- RelatedCurrencyManager.cs