Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Controls / SelectionChangedEventArgs.cs / 1 / 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
- Int32CollectionValueSerializer.cs
- ValuePatternIdentifiers.cs
- Utils.cs
- RequestResponse.cs
- XmlAttributeCache.cs
- SafePointer.cs
- Light.cs
- Gdiplus.cs
- TimeSpan.cs
- BooleanFacetDescriptionElement.cs
- ThreadStateException.cs
- PopupControlService.cs
- InProcStateClientManager.cs
- Window.cs
- ParserContext.cs
- RequestCachePolicyConverter.cs
- MultiSelectRootGridEntry.cs
- Int32Rect.cs
- Matrix.cs
- NativeMethods.cs
- MediaTimeline.cs
- Compensate.cs
- HtmlControlPersistable.cs
- JoinElimination.cs
- DesignerForm.cs
- TextParagraphView.cs
- CompressedStack.cs
- ArraySortHelper.cs
- DeclarativeCatalogPart.cs
- FilteredDataSetHelper.cs
- DataGridViewRowsRemovedEventArgs.cs
- AdornerHitTestResult.cs
- JavaScriptObjectDeserializer.cs
- NavigationService.cs
- QilScopedVisitor.cs
- IndexingContentUnit.cs
- SignedXmlDebugLog.cs
- AndMessageFilter.cs
- EntityParameter.cs
- SoapAttributes.cs
- XmlLinkedNode.cs
- DnsPermission.cs
- RefreshPropertiesAttribute.cs
- TextCompositionEventArgs.cs
- EmissiveMaterial.cs
- CodeStatementCollection.cs
- WmpBitmapDecoder.cs
- IPCCacheManager.cs
- _NegoState.cs
- IxmlLineInfo.cs
- DesignerOptions.cs
- TextBoxBase.cs
- FilterFactory.cs
- File.cs
- Condition.cs
- HelpEvent.cs
- Pkcs7Recipient.cs
- Number.cs
- NumberSubstitution.cs
- CreateUserWizard.cs
- StyleXamlParser.cs
- XmlDictionaryString.cs
- XmlRootAttribute.cs
- ConnectionsZone.cs
- GeometryHitTestResult.cs
- MatrixTransform3D.cs
- SqlUtils.cs
- ProviderException.cs
- TextOutput.cs
- TransactionState.cs
- Boolean.cs
- RootCodeDomSerializer.cs
- FieldBuilder.cs
- WindowsSpinner.cs
- ConfigurationLocationCollection.cs
- HMACSHA1.cs
- Duration.cs
- AttachmentCollection.cs
- AttributeParameterInfo.cs
- CodeAccessPermission.cs
- SortedSet.cs
- ComEventsMethod.cs
- EventSinkHelperWriter.cs
- PeerTransportCredentialType.cs
- HandlerFactoryCache.cs
- BitmapEffectDrawingContextState.cs
- PreviousTrackingServiceAttribute.cs
- PartialTrustVisibleAssembliesSection.cs
- MainMenu.cs
- DocumentPageHost.cs
- SerializationInfo.cs
- NavigationFailedEventArgs.cs
- AnnotationResourceChangedEventArgs.cs
- WindowsTab.cs
- XamlWriter.cs
- CommandExpr.cs
- MobileControl.cs
- WithStatement.cs
- FontUnit.cs
- PenCursorManager.cs