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
- TriggerActionCollection.cs
- ValueTable.cs
- ObjectSerializerFactory.cs
- KeyConstraint.cs
- CompositeCollection.cs
- LinqDataSourceSelectEventArgs.cs
- SQLMoney.cs
- XmlSerializationGeneratedCode.cs
- DataSetFieldSchema.cs
- PermissionSetEnumerator.cs
- SoapParser.cs
- ListViewDataItem.cs
- DbConnectionPool.cs
- VScrollProperties.cs
- DependencyPropertyDescriptor.cs
- TransactedBatchingElement.cs
- WpfMemberInvoker.cs
- LinqTreeNodeEvaluator.cs
- TypeDescriptorFilterService.cs
- PerformanceCounterPermissionEntryCollection.cs
- ManifestResourceInfo.cs
- RegisterInfo.cs
- SqlWebEventProvider.cs
- ObjectDisposedException.cs
- DataGridRowAutomationPeer.cs
- NativeMethods.cs
- UdpDiscoveryMessageFilter.cs
- StringUtil.cs
- TemplatingOptionsDialog.cs
- ObjectParameter.cs
- CellQuery.cs
- AuthorizationRuleCollection.cs
- ControllableStoryboardAction.cs
- RequestQueue.cs
- ActivityDesignerResources.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- StackBuilderSink.cs
- XmlUtil.cs
- CompilerLocalReference.cs
- FormsAuthenticationUserCollection.cs
- Package.cs
- RemoteCryptoSignHashRequest.cs
- SecureEnvironment.cs
- MediaTimeline.cs
- DecimalSumAggregationOperator.cs
- WS2007HttpBindingCollectionElement.cs
- ThicknessAnimationBase.cs
- List.cs
- SiteMapNode.cs
- WindowsAltTab.cs
- ColumnPropertiesGroup.cs
- MediaElement.cs
- PositiveTimeSpanValidatorAttribute.cs
- ComboBoxRenderer.cs
- WindowsListViewItem.cs
- PointAnimationUsingKeyFrames.cs
- ActivityCodeDomSerializationManager.cs
- AuthenticateEventArgs.cs
- MetadataItemCollectionFactory.cs
- BrowserCapabilitiesCompiler.cs
- PointAnimationBase.cs
- SqlConnectionHelper.cs
- RefreshInfo.cs
- TimelineCollection.cs
- ImageIndexEditor.cs
- HtmlInputHidden.cs
- BoundPropertyEntry.cs
- UnsafeNativeMethods.cs
- MarshalByValueComponent.cs
- CalendarDateChangedEventArgs.cs
- ReadOnlyHierarchicalDataSource.cs
- TextRangeAdaptor.cs
- TouchesOverProperty.cs
- login.cs
- Parameter.cs
- ConvertersCollection.cs
- ObsoleteAttribute.cs
- EndOfStreamException.cs
- CounterCreationDataConverter.cs
- Quad.cs
- TraceSection.cs
- SqlOuterApplyReducer.cs
- OneWayChannelListener.cs
- DictionaryKeyPropertyAttribute.cs
- InputBuffer.cs
- CharacterMetricsDictionary.cs
- Options.cs
- ToolStripDesignerAvailabilityAttribute.cs
- TextPatternIdentifiers.cs
- CultureData.cs
- InvokeWebServiceDesigner.cs
- DatasetMethodGenerator.cs
- Baml2006ReaderContext.cs
- TreeViewHitTestInfo.cs
- GridViewCancelEditEventArgs.cs
- SerializationSectionGroup.cs
- Root.cs
- WindowsNonControl.cs
- ArraySortHelper.cs
- ItemMap.cs