Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / System / Windows / RouteItem.cs / 1 / 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
- VectorAnimationBase.cs
- SessionStateModule.cs
- DataChangedEventManager.cs
- GridView.cs
- StandardCommands.cs
- TreeViewItemAutomationPeer.cs
- StrokeCollection2.cs
- LoginCancelEventArgs.cs
- QuadTree.cs
- EnumBuilder.cs
- FileLevelControlBuilderAttribute.cs
- AlternateViewCollection.cs
- _AcceptOverlappedAsyncResult.cs
- compensatingcollection.cs
- InkCanvasAutomationPeer.cs
- MouseDevice.cs
- ToolStripControlHost.cs
- ReachSerializableProperties.cs
- FixedSOMTableRow.cs
- WebHostedComPlusServiceHost.cs
- ReflectionPermission.cs
- WebPartZone.cs
- ControlParameter.cs
- COM2IDispatchConverter.cs
- DataRelation.cs
- SaveFileDialog.cs
- Tuple.cs
- ProgressBarAutomationPeer.cs
- HttpPostedFileWrapper.cs
- EntityCommandDefinition.cs
- XmlSchemaAll.cs
- DbRetry.cs
- RowVisual.cs
- NavigatingCancelEventArgs.cs
- ProfileGroupSettingsCollection.cs
- XmlAttributes.cs
- TypeContext.cs
- UnsafeNativeMethods.cs
- xamlnodes.cs
- Vector3dCollection.cs
- BreadCrumbTextConverter.cs
- Propagator.Evaluator.cs
- OperatingSystem.cs
- SpeechUI.cs
- PageMediaType.cs
- DispatcherProcessingDisabled.cs
- EdmValidator.cs
- Operator.cs
- NodeFunctions.cs
- Function.cs
- UrlAuthFailedErrorFormatter.cs
- VarRefManager.cs
- WSFederationHttpSecurity.cs
- ListBox.cs
- XmlTextReaderImpl.cs
- MsmqChannelListenerBase.cs
- TableRow.cs
- WebPartConnectionCollection.cs
- XMLSchema.cs
- PropertyFilterAttribute.cs
- ToolStripItemBehavior.cs
- MimeTypePropertyAttribute.cs
- IdleTimeoutMonitor.cs
- Hex.cs
- HttpStreamMessage.cs
- StackBuilderSink.cs
- HwndAppCommandInputProvider.cs
- XpsSerializationManager.cs
- KnownTypesProvider.cs
- DesignerActionTextItem.cs
- XmlCharCheckingReader.cs
- SHA384Managed.cs
- PeerEndPoint.cs
- TraceListeners.cs
- DataGridViewMethods.cs
- HtmlInputFile.cs
- ReflectPropertyDescriptor.cs
- Pair.cs
- FastEncoder.cs
- SafeThreadHandle.cs
- HttpHandlersInstallComponent.cs
- LocationReference.cs
- ExpressionVisitorHelpers.cs
- CreateUserWizard.cs
- BitmapEffect.cs
- ClassGenerator.cs
- MetadataSection.cs
- SimpleApplicationHost.cs
- TransactionScope.cs
- RichTextBox.cs
- XmlQueryCardinality.cs
- GradientBrush.cs
- CodeAssignStatement.cs
- LocalizableResourceBuilder.cs
- Paragraph.cs
- ProtocolImporter.cs
- __Error.cs
- SingleObjectCollection.cs
- DiscoveryClientProtocol.cs
- WinFormsSecurity.cs