Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- Menu.cs
- wgx_sdk_version.cs
- SoapObjectWriter.cs
- ElementAction.cs
- XmlTextWriter.cs
- PeerCollaborationPermission.cs
- ViewBase.cs
- StrongName.cs
- CodeConditionStatement.cs
- Point.cs
- LoadItemsEventArgs.cs
- OdbcInfoMessageEvent.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- ExceptionAggregator.cs
- ItemCollection.cs
- Stopwatch.cs
- HTMLTextWriter.cs
- MachineKeyValidationConverter.cs
- DataGridPageChangedEventArgs.cs
- xml.cs
- BitmapEffectState.cs
- ExclusiveCanonicalizationTransform.cs
- EnumConverter.cs
- DataKeyCollection.cs
- HwndKeyboardInputProvider.cs
- SizeAnimationBase.cs
- CommandPlan.cs
- SoapTypeAttribute.cs
- RuntimeConfig.cs
- ProgressBarBrushConverter.cs
- HtmlInputButton.cs
- HeaderCollection.cs
- SynchronizingStream.cs
- DataGridViewToolTip.cs
- MenuAutoFormat.cs
- Ports.cs
- ShaderEffect.cs
- EventMap.cs
- AdRotator.cs
- SqlTriggerAttribute.cs
- UIElement.cs
- CapabilitiesRule.cs
- EntitySqlQueryCacheEntry.cs
- OdbcHandle.cs
- ECDiffieHellmanPublicKey.cs
- Internal.cs
- TcpAppDomainProtocolHandler.cs
- FileChangesMonitor.cs
- DispatcherOperation.cs
- ActivityCompletionCallbackWrapper.cs
- MouseButtonEventArgs.cs
- MouseCaptureWithinProperty.cs
- XmlSchemaSimpleContentExtension.cs
- FixedTextView.cs
- UICuesEvent.cs
- MenuAutomationPeer.cs
- TypeUnloadedException.cs
- ASCIIEncoding.cs
- EDesignUtil.cs
- EventDescriptor.cs
- InfoCardSchemas.cs
- Page.cs
- TextServicesContext.cs
- WorkflowHostingResponseContext.cs
- Certificate.cs
- PersonalizableAttribute.cs
- Model3DGroup.cs
- DataContext.cs
- CompilationRelaxations.cs
- MimeTypeAttribute.cs
- RealProxy.cs
- XmlConvert.cs
- AutoGeneratedFieldProperties.cs
- AssemblyInfo.cs
- KeyInstance.cs
- PatternMatcher.cs
- XmlSchemaObjectTable.cs
- UrlMappingCollection.cs
- DataGridColumnFloatingHeader.cs
- StructuralType.cs
- TextElement.cs
- TimeSpanOrInfiniteConverter.cs
- DataBoundControlHelper.cs
- MouseGestureConverter.cs
- CodeActivityContext.cs
- DrawingContextWalker.cs
- CodePageUtils.cs
- GeneratedCodeAttribute.cs
- WebSysDefaultValueAttribute.cs
- WebServiceReceive.cs
- AliasedExpr.cs
- ControlDesigner.cs
- CallbackBehaviorAttribute.cs
- JsonWriterDelegator.cs
- ConfigurationPermission.cs
- ManipulationLogic.cs
- DataGridLinkButton.cs
- NgenServicingAttributes.cs
- LayoutTable.cs
- DataSysAttribute.cs