Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / RouteItem.cs / 1305600 / RouteItem.cs
using System; namespace System.Windows { // An item in the EventRoute // // RouteItem constitutes // the target object and // list of RoutedEventHandlerInfo that need // to be invoked upon the target object internal struct RouteItem { #region Construction // Constructor for RouteItem internal RouteItem(object target, RoutedEventHandlerInfo routedEventHandlerInfo) { _target = target; _routedEventHandlerInfo = routedEventHandlerInfo; } #endregion Construction #region Operations // Returns target internal object Target { get {return _target;} } // Invokes the associated RoutedEventHandler // on the target object with the given // RoutedEventArgs internal void InvokeHandler(RoutedEventArgs routedEventArgs) { _routedEventHandlerInfo.InvokeHandler(_target, routedEventArgs); } /* Commented out to avoid "uncalled private code" fxcop violation ////// Cleanup all the references within the data /// internal void Clear() { _target = null; _routedEventHandlerInfo.Clear(); } */ ////// Is the given object equals the current /// public override bool Equals(object o) { return Equals((RouteItem)o); } ////// Is the given RouteItem equals the current /// public bool Equals(RouteItem routeItem) { return ( routeItem._target == this._target && routeItem._routedEventHandlerInfo == this._routedEventHandlerInfo); } ////// Serves as a hash function for a particular type, suitable for use in /// hashing algorithms and data structures like a hash table /// public override int GetHashCode() { return base.GetHashCode(); } ////// Equals operator overload /// public static bool operator== (RouteItem routeItem1, RouteItem routeItem2) { return routeItem1.Equals(routeItem2); } ////// NotEquals operator overload /// public static bool operator!= (RouteItem routeItem1, RouteItem routeItem2) { return !routeItem1.Equals(routeItem2); } #endregion Operations #region Data private object _target; private RoutedEventHandlerInfo _routedEventHandlerInfo; #endregion Data } } // 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
- StreamingContext.cs
- TypeDescriptorContext.cs
- SafeBitVector32.cs
- _NegotiateClient.cs
- AutomationProperties.cs
- ParserStreamGeometryContext.cs
- SQLBoolean.cs
- TextRangeAdaptor.cs
- SqlNodeAnnotation.cs
- LinqDataSourceValidationException.cs
- EntityDataSourceQueryBuilder.cs
- WebPartTransformer.cs
- EnumerableCollectionView.cs
- CompositeKey.cs
- WaveHeader.cs
- AsyncOperation.cs
- CommentEmitter.cs
- IndexOutOfRangeException.cs
- LinqExpressionNormalizer.cs
- _IPv4Address.cs
- MsmqIntegrationMessageProperty.cs
- PreviewPrintController.cs
- FormViewModeEventArgs.cs
- Encoding.cs
- WindowsTab.cs
- SqlConnectionStringBuilder.cs
- IfAction.cs
- IArgumentProvider.cs
- Point3DAnimationBase.cs
- DataGridViewColumnStateChangedEventArgs.cs
- TypeElement.cs
- DynamicRenderer.cs
- MenuAdapter.cs
- Executor.cs
- XmlElementList.cs
- SyndicationFeedFormatter.cs
- DataGridViewComboBoxCell.cs
- ShimAsPublicXamlType.cs
- XmlWriterTraceListener.cs
- TextDecorationCollection.cs
- SiteMapNodeItemEventArgs.cs
- WorkflowDesignerColors.cs
- RelatedEnd.cs
- ClientConfigurationHost.cs
- RelatedEnd.cs
- SqlDataSourceQueryConverter.cs
- RadioButton.cs
- UIElementParaClient.cs
- WindowsGrip.cs
- MergeFilterQuery.cs
- ByteStreamGeometryContext.cs
- ReaderContextStackData.cs
- ControlPropertyNameConverter.cs
- SoapClientProtocol.cs
- StreamUpdate.cs
- DataGridViewComboBoxCell.cs
- MultipleViewProviderWrapper.cs
- ScrollChrome.cs
- CellLabel.cs
- EventProviderWriter.cs
- Line.cs
- BuilderPropertyEntry.cs
- EventRoute.cs
- DataRelationPropertyDescriptor.cs
- peersecuritysettings.cs
- ObjectDataSourceChooseTypePanel.cs
- HashUtility.cs
- Logging.cs
- AnnotationMap.cs
- WebSysDefaultValueAttribute.cs
- WebPartExportVerb.cs
- TypeBuilderInstantiation.cs
- ImageSource.cs
- InkCanvasSelection.cs
- AudioFileOut.cs
- SchemaAttDef.cs
- TabControlAutomationPeer.cs
- RepeatButtonAutomationPeer.cs
- InheritanceRules.cs
- RepeaterDesigner.cs
- OnOperation.cs
- TypedReference.cs
- DataGridViewSelectedColumnCollection.cs
- XhtmlConformanceSection.cs
- ListBindableAttribute.cs
- CompositeCollection.cs
- XsdDuration.cs
- VirtualDirectoryMapping.cs
- FileUpload.cs
- TransformPattern.cs
- FormViewInsertedEventArgs.cs
- DSACryptoServiceProvider.cs
- SignedXml.cs
- MessageFault.cs
- SqlDataSourceFilteringEventArgs.cs
- DateTimeFormatInfoScanner.cs
- XPathBuilder.cs
- Int32EqualityComparer.cs
- Validator.cs
- QueryRewriter.cs