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
- Rotation3D.cs
- ObjectQueryExecutionPlan.cs
- Crc32.cs
- ExceptionWrapper.cs
- AttributeUsageAttribute.cs
- SendMailErrorEventArgs.cs
- DataGridCaption.cs
- MouseBinding.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- LambdaCompiler.cs
- Rule.cs
- TextFormattingConverter.cs
- EncoderBestFitFallback.cs
- DelegateBodyWriter.cs
- Win32Native.cs
- ItemsControlAutomationPeer.cs
- ViewRendering.cs
- Thickness.cs
- Tuple.cs
- RelationshipEnd.cs
- HierarchicalDataBoundControl.cs
- SelectionPattern.cs
- CodeMethodReturnStatement.cs
- ApplicationSecurityInfo.cs
- VsPropertyGrid.cs
- Label.cs
- TablePattern.cs
- SelectionUIHandler.cs
- ServicePointManagerElement.cs
- LingerOption.cs
- EventToken.cs
- RolePrincipal.cs
- MimeReturn.cs
- SequentialUshortCollection.cs
- WSAddressing10ProblemHeaderQNameFault.cs
- TextFindEngine.cs
- HtmlHistory.cs
- RTTrackingProfile.cs
- PerformanceCounterManager.cs
- DefaultParameterValueAttribute.cs
- PermissionToken.cs
- SqlInfoMessageEvent.cs
- EditorAttribute.cs
- invalidudtexception.cs
- PointLightBase.cs
- Light.cs
- DbgCompiler.cs
- DataViewSetting.cs
- ModifiableIteratorCollection.cs
- SqlTrackingWorkflowInstance.cs
- ToolStripDropDownItemDesigner.cs
- NoPersistProperty.cs
- UnwrappedTypesXmlSerializerManager.cs
- LinearGradientBrush.cs
- Sql8ExpressionRewriter.cs
- RepeaterCommandEventArgs.cs
- MetabaseServerConfig.cs
- AppDomainFactory.cs
- ValueConversionAttribute.cs
- DynamicRenderer.cs
- ServiceDeploymentInfo.cs
- MethodCallConverter.cs
- ReturnValue.cs
- mediaeventshelper.cs
- SrgsSubset.cs
- VisualTarget.cs
- ContentControl.cs
- XpsDigitalSignature.cs
- CodeTypeMember.cs
- IndexExpression.cs
- Aes.cs
- ObservableDictionary.cs
- SignatureResourceHelper.cs
- FontConverter.cs
- UserNameSecurityTokenParameters.cs
- AuthenticationManager.cs
- Screen.cs
- PcmConverter.cs
- DataViewSetting.cs
- cache.cs
- Opcode.cs
- TextBoxBase.cs
- WebPartConnectionsCancelVerb.cs
- SignatureHelper.cs
- TextBox.cs
- TextRange.cs
- CodeLinePragma.cs
- ValidationPropertyAttribute.cs
- EdmToObjectNamespaceMap.cs
- DirectoryObjectSecurity.cs
- DurationConverter.cs
- _ServiceNameStore.cs
- HttpConfigurationSystem.cs
- CommandPlan.cs
- TraceSource.cs
- XmlNamedNodeMap.cs
- TagPrefixAttribute.cs
- DispatcherHookEventArgs.cs
- Color.cs
- SystemSounds.cs