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
- ConnectionManagementElementCollection.cs
- LineBreakRecord.cs
- BreakRecordTable.cs
- FileLogRecordStream.cs
- TrackingRecord.cs
- SqlDataReader.cs
- DebugController.cs
- RectConverter.cs
- AudioFileOut.cs
- AuthorizationRuleCollection.cs
- DeferredReference.cs
- ActiveXHost.cs
- Executor.cs
- CommonXSendMessage.cs
- ColorContext.cs
- MailAddress.cs
- InternalTypeHelper.cs
- MultitargetUtil.cs
- CodeDomConfigurationHandler.cs
- DataControlFieldCollection.cs
- SourceItem.cs
- ObjectDataSourceStatusEventArgs.cs
- DecoratedNameAttribute.cs
- LoginView.cs
- ToolStripContentPanelRenderEventArgs.cs
- MessageQueuePermissionEntryCollection.cs
- UserMapPath.cs
- ChtmlTextWriter.cs
- StateBag.cs
- System.Data_BID.cs
- AllMembershipCondition.cs
- filewebrequest.cs
- AndCondition.cs
- odbcmetadatacollectionnames.cs
- WebPartActionVerb.cs
- NativeObjectSecurity.cs
- OleDbEnumerator.cs
- PathGeometry.cs
- EffectiveValueEntry.cs
- EventSetter.cs
- OdbcConnectionPoolProviderInfo.cs
- MyContact.cs
- EmptyQuery.cs
- BaseDataBoundControl.cs
- ClusterRegistryConfigurationProvider.cs
- CommentEmitter.cs
- Activity.cs
- controlskin.cs
- EtwTrackingBehavior.cs
- UpdateManifestForBrowserApplication.cs
- EdmScalarPropertyAttribute.cs
- MembershipUser.cs
- InputReportEventArgs.cs
- XmlMembersMapping.cs
- MenuRendererStandards.cs
- X509ChainElement.cs
- _SSPIWrapper.cs
- SecurityTokenInclusionMode.cs
- DesignerContextDescriptor.cs
- ViewGenerator.cs
- VolatileEnlistmentMultiplexing.cs
- MenuAutomationPeer.cs
- DataGridViewRowPrePaintEventArgs.cs
- ArrayTypeMismatchException.cs
- AuthenticationModuleElement.cs
- ClientScriptManager.cs
- dbenumerator.cs
- DragDeltaEventArgs.cs
- WebServiceReceiveDesigner.cs
- RadialGradientBrush.cs
- EntityDescriptor.cs
- EditorAttribute.cs
- ConnectionInterfaceCollection.cs
- OleDbConnection.cs
- ByteStreamMessageEncoder.cs
- OperatorExpressions.cs
- IsolatedStorageException.cs
- CodeTypeParameter.cs
- DataGridColumnCollection.cs
- DataGrid.cs
- ContravarianceAdapter.cs
- SoapIgnoreAttribute.cs
- MouseActionValueSerializer.cs
- DateTimeConverter.cs
- SchemaType.cs
- SchemaContext.cs
- RemotingException.cs
- ResXFileRef.cs
- ConfigurationException.cs
- ServiceContractAttribute.cs
- ChtmlTextWriter.cs
- VisualTransition.cs
- AlphaSortedEnumConverter.cs
- DataGridPreparingCellForEditEventArgs.cs
- TextBox.cs
- UnconditionalPolicy.cs
- ClusterRegistryConfigurationProvider.cs
- SelectionChangedEventArgs.cs
- MULTI_QI.cs
- DbConnectionHelper.cs