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
- RuntimeArgument.cs
- SelectorItemAutomationPeer.cs
- TextCompositionEventArgs.cs
- Image.cs
- DataGridRowHeader.cs
- BaseTemplateBuildProvider.cs
- ConfigurationSectionHelper.cs
- odbcmetadatacollectionnames.cs
- DataGridCell.cs
- ObjectView.cs
- QilLiteral.cs
- EventProvider.cs
- IdnMapping.cs
- UnsafeNativeMethods.cs
- DesignerActionPanel.cs
- GlyphShapingProperties.cs
- TextServicesPropertyRanges.cs
- WorkflowServiceBuildProvider.cs
- ResourceFallbackManager.cs
- SectionInput.cs
- columnmapkeybuilder.cs
- HttpCapabilitiesSectionHandler.cs
- MethodCallTranslator.cs
- ServiceDescriptions.cs
- DrawingState.cs
- Stack.cs
- AudioLevelUpdatedEventArgs.cs
- ColorTransform.cs
- SafeCertificateStore.cs
- Point.cs
- Model3D.cs
- WindowsFormsHostPropertyMap.cs
- DataGridPageChangedEventArgs.cs
- WebPartDescriptionCollection.cs
- Exceptions.cs
- log.cs
- TimelineClockCollection.cs
- ToolStripContextMenu.cs
- RenderDataDrawingContext.cs
- Debug.cs
- TaskHelper.cs
- IDQuery.cs
- IndexedEnumerable.cs
- XmlComplianceUtil.cs
- NameValueConfigurationCollection.cs
- StreamReader.cs
- PropertyDescriptor.cs
- X509Certificate2.cs
- HttpValueCollection.cs
- SolidColorBrush.cs
- ListView.cs
- BasicAsyncResult.cs
- UserUseLicenseDictionaryLoader.cs
- ProcessManager.cs
- SequenceDesigner.xaml.cs
- SamlAuthenticationClaimResource.cs
- TypeToArgumentTypeConverter.cs
- ObjectKeyFrameCollection.cs
- TableHeaderCell.cs
- BufferedWebEventProvider.cs
- XslAstAnalyzer.cs
- DbCommandDefinition.cs
- DataStreams.cs
- RootDesignerSerializerAttribute.cs
- DataGridViewRow.cs
- EntityDataSourceView.cs
- XmlReflectionMember.cs
- SecurityKeyIdentifier.cs
- WebPartCloseVerb.cs
- InvalidBodyAccessException.cs
- DataControlFieldCollection.cs
- SourceFilter.cs
- RelatedImageListAttribute.cs
- TableItemProviderWrapper.cs
- RichTextBoxContextMenu.cs
- CrossSiteScriptingValidation.cs
- CopyAttributesAction.cs
- LeaseManager.cs
- ForceCopyBuildProvider.cs
- ArcSegment.cs
- SecurityHelper.cs
- EntityClassGenerator.cs
- AdapterDictionary.cs
- OutputScope.cs
- Queue.cs
- Sequence.cs
- ConstraintStruct.cs
- DescendantBaseQuery.cs
- WebPartVerb.cs
- SelfIssuedAuthAsymmetricKey.cs
- RawStylusInputCustomData.cs
- GZipUtils.cs
- LinkLabelLinkClickedEvent.cs
- TraceHandlerErrorFormatter.cs
- ModelFunction.cs
- LateBoundBitmapDecoder.cs
- TextRunCacheImp.cs
- Semaphore.cs
- PeerNameRecord.cs
- IndexedString.cs