Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / 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. //---------------------------------------------------------------------------- // // 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
- DoWhile.cs
- Location.cs
- BatchParser.cs
- HandledMouseEvent.cs
- ClassHandlersStore.cs
- UshortList2.cs
- GridViewCommandEventArgs.cs
- ClientBuildManager.cs
- ItemCollection.cs
- XPathItem.cs
- NavigationFailedEventArgs.cs
- DbDataReader.cs
- ModifyActivitiesPropertyDescriptor.cs
- OleDbWrapper.cs
- ImageAutomationPeer.cs
- SystemPens.cs
- DataGridViewColumnEventArgs.cs
- StrongName.cs
- ProfileService.cs
- SemanticValue.cs
- BuildProvidersCompiler.cs
- UriWriter.cs
- DataGridViewUtilities.cs
- ComboBox.cs
- CodeMethodReturnStatement.cs
- PKCS1MaskGenerationMethod.cs
- RegistryHandle.cs
- XmlFormatExtensionPointAttribute.cs
- WindowsToolbarAsMenu.cs
- _ListenerRequestStream.cs
- WebControlParameterProxy.cs
- CompilationRelaxations.cs
- ObjectAnimationUsingKeyFrames.cs
- SoapSchemaMember.cs
- CodeExpressionCollection.cs
- DocumentPage.cs
- FileSystemEnumerable.cs
- UnsafeNativeMethods.cs
- MsmqInputChannelBase.cs
- MouseActionConverter.cs
- SingleResultAttribute.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- WindowsFormsEditorServiceHelper.cs
- SendingRequestEventArgs.cs
- ProtocolReflector.cs
- DBCSCodePageEncoding.cs
- CombinedGeometry.cs
- TextElementCollectionHelper.cs
- CompareValidator.cs
- DataControlFieldHeaderCell.cs
- GlobalizationSection.cs
- CompoundFileDeflateTransform.cs
- SmiEventStream.cs
- GridViewColumnHeaderAutomationPeer.cs
- CollectionConverter.cs
- SynchronizationContext.cs
- StylusButton.cs
- AddInToken.cs
- TextTabProperties.cs
- StatusBarPanelClickEvent.cs
- CreateUserWizardStep.cs
- AppLevelCompilationSectionCache.cs
- DataGridViewCheckBoxCell.cs
- Version.cs
- LayoutEngine.cs
- ProfileModule.cs
- ActivityCodeDomSerializationManager.cs
- TTSEngineProxy.cs
- RSAPKCS1KeyExchangeFormatter.cs
- GenericTypeParameterBuilder.cs
- ClientRoleProvider.cs
- DesignerTransactionCloseEvent.cs
- BrushMappingModeValidation.cs
- LinkAreaEditor.cs
- StylusButtonEventArgs.cs
- AuthenticatingEventArgs.cs
- TextBoxBase.cs
- ReceiveActivityDesigner.cs
- Maps.cs
- CardSpaceSelector.cs
- ThreadPool.cs
- TreeView.cs
- Typeface.cs
- RunClient.cs
- NativeCppClassAttribute.cs
- _SslSessionsCache.cs
- ContextQuery.cs
- ValidatedMobileControlConverter.cs
- TextCharacters.cs
- X509AsymmetricSecurityKey.cs
- SmtpMail.cs
- HttpValueCollection.cs
- WmlSelectionListAdapter.cs
- LoadWorkflowAsyncResult.cs
- DSACryptoServiceProvider.cs
- SmtpSection.cs
- StoreItemCollection.cs
- Point4D.cs
- ToolStripRenderer.cs
- SearchForVirtualItemEventArgs.cs