Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Controls / TextChangedEventArgs.cs / 2 / TextChangedEventArgs.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: TextChanged event argument. // // History: // 09/27/2004 : [....] - Created // //--------------------------------------------------------------------------- using System.ComponentModel; using System.Windows.Documents; using System.Collections.Generic; using System.Collections.ObjectModel; namespace System.Windows.Controls { #region TextChangedEvent ////// How the undo stack caused or is affected by a text change. /// public enum UndoAction { ////// This change will not affect the undo stack at all /// None = 0, ////// This change will merge into the previous undo unit /// Merge = 1, ////// This change is the result of a call to Undo() /// Undo = 2, ////// This change is the result of a call to Redo() /// Redo = 3, ////// This change will clear the undo stack /// Clear = 4, ////// This change will create a new undo unit /// Create = 5 } ////// The delegate to use for handlers that receive TextChangedEventArgs /// public delegate void TextChangedEventHandler(object sender, TextChangedEventArgs e); ////// The TextChangedEventArgs class represents a type of RoutedEventArgs that /// are relevant to events raised by changing editable text. /// public class TextChangedEventArgs : RoutedEventArgs { ////// constructor /// /// event id /// UndoAction /// ReadOnlyCollection public TextChangedEventArgs(RoutedEvent id, UndoAction action, ICollectionchanges) : base() { if (id == null) { throw new ArgumentNullException("id"); } if (action < UndoAction.None || action > UndoAction.Create) { throw new InvalidEnumArgumentException("action", (int)action, typeof(UndoAction)); } RoutedEvent=id; _undoAction = action; _changes = changes; } /// /// constructor /// /// event id /// UndoAction public TextChangedEventArgs(RoutedEvent id, UndoAction action) : this(id, action, new ReadOnlyCollection(new List ())) { } /// /// How the undo stack caused or is affected by this text change /// ///UndoAction enum public UndoAction UndoAction { get { return _undoAction; } } ////// A readonly list of TextChanges, sorted by offset in order from the beginning to the end of /// the document, describing the dirty areas of the document and in what way(s) those /// areas differ from the pre-change document. For example, if content at offset 0 was: /// /// The quick brown fox jumps over the lazy dog. /// /// and changed to: /// /// The brown fox jumps over a dog. /// /// Changes would contain two TextChanges with the following information: /// /// Change 1 /// -------- /// Offset: 5 /// RemovedCount: 6 /// AddedCount: 0 /// PropertyCount: 0 /// /// Change 2 /// -------- /// Offset: 26 /// RemovedCount: 8 /// AddedCount: 1 /// PropertyCount: 0 /// /// If no changes were made, the collection will be empty. /// public ICollectionChanges { get { return _changes; } } /// /// The mechanism used to call the type-specific handler on the /// target. /// /// /// The generic handler to call in a type-specific way. /// /// /// The target to call the handler on. /// protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { TextChangedEventHandler handler; handler = (TextChangedEventHandler)genericHandler; handler(genericTarget, this); } private UndoAction _undoAction; private readonly ICollection_changes; } #endregion TextChangedEvent } // 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
- ContentPathSegment.cs
- SqlUserDefinedTypeAttribute.cs
- AffineTransform3D.cs
- TransformedBitmap.cs
- CodeTypeOfExpression.cs
- XmlDocumentFragment.cs
- WebHttpSecurityElement.cs
- X509Utils.cs
- GridViewCancelEditEventArgs.cs
- ViewGenResults.cs
- BufferedWebEventProvider.cs
- WmlTextBoxAdapter.cs
- IndentedTextWriter.cs
- UIElement3D.cs
- BrowserCapabilitiesCompiler.cs
- DataGridCellItemAutomationPeer.cs
- TableCellAutomationPeer.cs
- Translator.cs
- MailWriter.cs
- CheckBoxDesigner.cs
- DataFormats.cs
- METAHEADER.cs
- FileDialogPermission.cs
- ListDesigner.cs
- DynamicControlParameter.cs
- GenerateTemporaryTargetAssembly.cs
- RuntimeEnvironment.cs
- QueuePathEditor.cs
- LogWriteRestartAreaState.cs
- ClientSettingsProvider.cs
- InstanceDataCollection.cs
- DataBoundLiteralControl.cs
- BuildManager.cs
- DataBinding.cs
- FunctionNode.cs
- PathFigure.cs
- DbConnectionFactory.cs
- CodeSnippetCompileUnit.cs
- cookiecontainer.cs
- WebConfigurationManager.cs
- HasRunnableWorkflowEvent.cs
- CollectionDataContract.cs
- VirtualDirectoryMapping.cs
- ClientSession.cs
- Parsers.cs
- PropertiesTab.cs
- DropTarget.cs
- SelectingProviderEventArgs.cs
- EntityDesignerUtils.cs
- ThicknessAnimationUsingKeyFrames.cs
- EpmSyndicationContentDeSerializer.cs
- COMException.cs
- Trace.cs
- DoubleLinkList.cs
- ReferentialConstraintRoleElement.cs
- NullableFloatMinMaxAggregationOperator.cs
- WhitespaceSignificantCollectionAttribute.cs
- CursorConverter.cs
- ResourcePool.cs
- FilteredXmlReader.cs
- TagPrefixInfo.cs
- Error.cs
- DesigntimeLicenseContext.cs
- CodeObjectCreateExpression.cs
- ValidationError.cs
- XDRSchema.cs
- MetadataItemCollectionFactory.cs
- SqlDataSourceFilteringEventArgs.cs
- SmiConnection.cs
- XmlSchemaAnnotated.cs
- DirectoryLocalQuery.cs
- ScriptingRoleServiceSection.cs
- SystemFonts.cs
- ToolStripDropDownItem.cs
- RefreshEventArgs.cs
- XmlTextAttribute.cs
- DataServiceProviderWrapper.cs
- InputEventArgs.cs
- ValuePattern.cs
- IListConverters.cs
- SqlTrackingService.cs
- HtmlElement.cs
- XmlSchemaAnyAttribute.cs
- XmlReaderSettings.cs
- DataGridViewComboBoxColumnDesigner.cs
- Query.cs
- COM2EnumConverter.cs
- UserControlCodeDomTreeGenerator.cs
- HMACMD5.cs
- TextSpanModifier.cs
- MemberAssignmentAnalysis.cs
- TextDecoration.cs
- TCEAdapterGenerator.cs
- TransformGroup.cs
- Section.cs
- SimpleModelProvider.cs
- DataGridViewCellFormattingEventArgs.cs
- EventListenerClientSide.cs
- TableItemPatternIdentifiers.cs
- TableItemProviderWrapper.cs