Code:
/ 4.0 / 4.0 / 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. 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
- ExchangeUtilities.cs
- CodeArgumentReferenceExpression.cs
- ButtonField.cs
- BindingsCollection.cs
- CngKey.cs
- RepeatBehaviorConverter.cs
- CriticalFinalizerObject.cs
- PositiveTimeSpanValidator.cs
- SqlDataSourceWizardForm.cs
- ApplicationFileCodeDomTreeGenerator.cs
- HealthMonitoringSection.cs
- DataObjectSettingDataEventArgs.cs
- StopStoryboard.cs
- GatewayDefinition.cs
- PageAsyncTask.cs
- BreakSafeBase.cs
- PresentationAppDomainManager.cs
- PathGeometry.cs
- RadioButtonFlatAdapter.cs
- Stack.cs
- TypeSystemProvider.cs
- EDesignUtil.cs
- DataBindingHandlerAttribute.cs
- FilterableData.cs
- LinqDataSourceInsertEventArgs.cs
- SqlNamer.cs
- DataGridViewBindingCompleteEventArgs.cs
- Vertex.cs
- DesignerDeviceConfig.cs
- XamlInt32CollectionSerializer.cs
- XmlSerializationGeneratedCode.cs
- SocketElement.cs
- ProfessionalColors.cs
- WebBrowserNavigatedEventHandler.cs
- Part.cs
- ZipFileInfoCollection.cs
- RoleManagerEventArgs.cs
- TreeNodeCollection.cs
- GacUtil.cs
- MetadataResolver.cs
- TreeViewTemplateSelector.cs
- IIS7WorkerRequest.cs
- XamlStackWriter.cs
- EncryptedKey.cs
- DataControlPagerLinkButton.cs
- WindowsStreamSecurityBindingElement.cs
- ListSurrogate.cs
- EdmPropertyAttribute.cs
- TextHidden.cs
- CollaborationHelperFunctions.cs
- XmlCharCheckingReader.cs
- InputReportEventArgs.cs
- OperationResponse.cs
- InternalPermissions.cs
- BitmapPalettes.cs
- ApplyImportsAction.cs
- SqlMethodAttribute.cs
- TaskHelper.cs
- BitmapEffectOutputConnector.cs
- ConstraintStruct.cs
- SelectionGlyph.cs
- PeerNameRegistration.cs
- RadioButtonBaseAdapter.cs
- ExpressionBuilderContext.cs
- ChannelEndpointElement.cs
- UIElement.cs
- ErrorTableItemStyle.cs
- HttpResponseBase.cs
- MetadataExchangeBindings.cs
- BaseInfoTable.cs
- ExpressionBindingCollection.cs
- PtsHost.cs
- PriorityBindingExpression.cs
- odbcmetadatacollectionnames.cs
- XslCompiledTransform.cs
- InternalMappingException.cs
- SurrogateSelector.cs
- GroupBoxDesigner.cs
- KeyFrames.cs
- Parameter.cs
- CompatibleComparer.cs
- ReceiveSecurityHeaderEntry.cs
- XamlReader.cs
- HttpApplication.cs
- StandardToolWindows.cs
- NonParentingControl.cs
- MetadataWorkspace.cs
- ExpanderAutomationPeer.cs
- ImageIndexConverter.cs
- SerializationSectionGroup.cs
- InsufficientExecutionStackException.cs
- PerformanceCounterLib.cs
- EntityContainerEntitySetDefiningQuery.cs
- DataContractSerializerSection.cs
- InvariantComparer.cs
- QilVisitor.cs
- XmlDigitalSignatureProcessor.cs
- TextFormatter.cs
- ThicknessAnimation.cs
- FragmentQuery.cs