Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / SelectionChangedEventArgs.cs / 1305600 / SelectionChangedEventArgs.cs
using System.ComponentModel; using System.Collections; using System.Collections.Generic; using System.Windows.Threading; using System.Windows.Data; using System.Windows.Automation; using System.Windows.Automation.Provider; using MS.Utility; using System.Windows; using System; using System.Diagnostics; namespace System.Windows.Controls { ////// The delegate type for handling a selection changed event /// public delegate void SelectionChangedEventHandler( object sender, SelectionChangedEventArgs e); ////// The inputs to a selection changed event handler /// public class SelectionChangedEventArgs : RoutedEventArgs { #region Constructors ////// The constructor for selection changed args /// /// The event ID for the event about to fire -- should probably be Selector.SelectionChangedEvent /// The items that were unselected during this event /// The items that were selected during this event public SelectionChangedEventArgs( RoutedEvent id, IList removedItems, IList addedItems) { if (id == null) throw new ArgumentNullException("id"); if (removedItems == null) throw new ArgumentNullException("removedItems"); if (addedItems == null) throw new ArgumentNullException("addedItems"); RoutedEvent = id; _removedItems = new object[removedItems.Count]; removedItems.CopyTo(_removedItems, 0); _addedItems = new object[addedItems.Count]; addedItems.CopyTo(_addedItems, 0); } internal SelectionChangedEventArgs(IList removedItems, IList addedItems) : this(System.Windows.Controls.Primitives.Selector.SelectionChangedEvent, removedItems, addedItems) { } #endregion #region Public Properties ////// An IList containing the items that were unselected during this event /// public IList RemovedItems { get { return _removedItems; } } ////// An IList containing the items that were selected during this event /// public IList AddedItems { get { return _addedItems; } } #endregion #region Protected Methods ////// This method is used to perform the proper type casting in order to /// call the type-safe SelectionChangedEventHandler delegate for the SelectionChangedEvent event. /// /// The handler to invoke. /// The current object along the event's route. protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { SelectionChangedEventHandler handler = (SelectionChangedEventHandler)genericHandler; handler(genericTarget, this); } #endregion #region Data private object[] _addedItems; private object[] _removedItems; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System.ComponentModel; using System.Collections; using System.Collections.Generic; using System.Windows.Threading; using System.Windows.Data; using System.Windows.Automation; using System.Windows.Automation.Provider; using MS.Utility; using System.Windows; using System; using System.Diagnostics; namespace System.Windows.Controls { ////// The delegate type for handling a selection changed event /// public delegate void SelectionChangedEventHandler( object sender, SelectionChangedEventArgs e); ////// The inputs to a selection changed event handler /// public class SelectionChangedEventArgs : RoutedEventArgs { #region Constructors ////// The constructor for selection changed args /// /// The event ID for the event about to fire -- should probably be Selector.SelectionChangedEvent /// The items that were unselected during this event /// The items that were selected during this event public SelectionChangedEventArgs( RoutedEvent id, IList removedItems, IList addedItems) { if (id == null) throw new ArgumentNullException("id"); if (removedItems == null) throw new ArgumentNullException("removedItems"); if (addedItems == null) throw new ArgumentNullException("addedItems"); RoutedEvent = id; _removedItems = new object[removedItems.Count]; removedItems.CopyTo(_removedItems, 0); _addedItems = new object[addedItems.Count]; addedItems.CopyTo(_addedItems, 0); } internal SelectionChangedEventArgs(IList removedItems, IList addedItems) : this(System.Windows.Controls.Primitives.Selector.SelectionChangedEvent, removedItems, addedItems) { } #endregion #region Public Properties ////// An IList containing the items that were unselected during this event /// public IList RemovedItems { get { return _removedItems; } } ////// An IList containing the items that were selected during this event /// public IList AddedItems { get { return _addedItems; } } #endregion #region Protected Methods ////// This method is used to perform the proper type casting in order to /// call the type-safe SelectionChangedEventHandler delegate for the SelectionChangedEvent event. /// /// The handler to invoke. /// The current object along the event's route. protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { SelectionChangedEventHandler handler = (SelectionChangedEventHandler)genericHandler; handler(genericTarget, this); } #endregion #region Data private object[] _addedItems; private object[] _removedItems; #endregion } } // 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
- XmlILTrace.cs
- PerformanceCounterLib.cs
- recordstatescratchpad.cs
- StateBag.cs
- Application.cs
- SymbolDocumentGenerator.cs
- NullReferenceException.cs
- TerminateSequence.cs
- InstanceValue.cs
- XmlIncludeAttribute.cs
- HtmlControl.cs
- HttpListenerPrefixCollection.cs
- AstTree.cs
- EventEntry.cs
- DivideByZeroException.cs
- X509Certificate2Collection.cs
- HybridDictionary.cs
- SqlDataSourceQueryEditor.cs
- NamedPipeConnectionPoolSettings.cs
- DecimalAverageAggregationOperator.cs
- Misc.cs
- GrammarBuilderRuleRef.cs
- CodeTypeDelegate.cs
- XmlSchemaException.cs
- PropertyDescriptorGridEntry.cs
- safex509handles.cs
- DataGridViewColumnEventArgs.cs
- SqlWriter.cs
- LocalValueEnumerator.cs
- DbTransaction.cs
- GifBitmapDecoder.cs
- DeriveBytes.cs
- VisualStateManager.cs
- GenericParameterDataContract.cs
- ControlValuePropertyAttribute.cs
- RightsManagementEncryptedStream.cs
- AutoGeneratedField.cs
- _LoggingObject.cs
- ReflectionUtil.cs
- LayoutTable.cs
- DataBindingCollectionEditor.cs
- InvalidOleVariantTypeException.cs
- FunctionMappingTranslator.cs
- FilteredSchemaElementLookUpTable.cs
- MarshalDirectiveException.cs
- HtmlFormWrapper.cs
- ToolStripDropTargetManager.cs
- Vector3D.cs
- BitmapMetadataEnumerator.cs
- PageThemeBuildProvider.cs
- PrincipalPermission.cs
- AnimationException.cs
- FontClient.cs
- ProfileGroupSettings.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- BevelBitmapEffect.cs
- KeyGestureConverter.cs
- ManualResetEvent.cs
- Command.cs
- ByteConverter.cs
- Point.cs
- BindingContext.cs
- DocumentAutomationPeer.cs
- DataServiceRequestException.cs
- DataTableNewRowEvent.cs
- ReaderWriterLockWrapper.cs
- SchemaImporter.cs
- ApplicationDirectoryMembershipCondition.cs
- BaseDataListPage.cs
- HostedAspNetEnvironment.cs
- GCHandleCookieTable.cs
- XhtmlBasicCommandAdapter.cs
- RectAnimationClockResource.cs
- MsmqIntegrationBindingElement.cs
- MessageSmuggler.cs
- ManualWorkflowSchedulerService.cs
- RoleGroup.cs
- SchemaImporter.cs
- FloatUtil.cs
- InvariantComparer.cs
- MaskedTextBoxTextEditorDropDown.cs
- InvalidPrinterException.cs
- WindowsRichEditRange.cs
- QilCloneVisitor.cs
- DataPagerFieldItem.cs
- XmlWrappingReader.cs
- BitmapMetadataBlob.cs
- HtmlFormWrapper.cs
- _AuthenticationState.cs
- Parsers.cs
- ContentDisposition.cs
- XMLSchema.cs
- CompiledIdentityConstraint.cs
- QuaternionRotation3D.cs
- ExtendedProperty.cs
- Logging.cs
- ContextMenuStrip.cs
- SymbolType.cs
- WindowsFormsHelpers.cs
- MethodExpr.cs