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
- CultureInfoConverter.cs
- TraceListeners.cs
- OdbcStatementHandle.cs
- ItemsControlAutomationPeer.cs
- WindowsAltTab.cs
- DatePicker.cs
- StrongNameMembershipCondition.cs
- HwndAppCommandInputProvider.cs
- MoveSizeWinEventHandler.cs
- DataProtection.cs
- IArgumentProvider.cs
- MultiTrigger.cs
- ZipIOLocalFileBlock.cs
- InkCanvasFeedbackAdorner.cs
- HttpDebugHandler.cs
- GenerateTemporaryTargetAssembly.cs
- Block.cs
- FacetChecker.cs
- MessageDecoder.cs
- BooleanFunctions.cs
- ReadOnlyDictionary.cs
- RootDesignerSerializerAttribute.cs
- ObjectListShowCommandsEventArgs.cs
- SiteMapProvider.cs
- ListMarkerSourceInfo.cs
- Task.cs
- DateTimeUtil.cs
- ControlPropertyNameConverter.cs
- ImageIndexConverter.cs
- DataGridViewCellEventArgs.cs
- MergeLocalizationDirectives.cs
- GACMembershipCondition.cs
- adornercollection.cs
- StateValidator.cs
- HandleCollector.cs
- ViewManagerAttribute.cs
- StructuredTypeEmitter.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- messageonlyhwndwrapper.cs
- JoinSymbol.cs
- BindingGraph.cs
- Int64AnimationUsingKeyFrames.cs
- TextElementEditingBehaviorAttribute.cs
- DebugView.cs
- PageThemeBuildProvider.cs
- PathBox.cs
- IssuanceLicense.cs
- LinqDataSourceUpdateEventArgs.cs
- DurableErrorHandler.cs
- COM2ColorConverter.cs
- NumericPagerField.cs
- JoinGraph.cs
- WindowsMenu.cs
- WebSysDescriptionAttribute.cs
- TypeBuilder.cs
- DefaultPrintController.cs
- Matrix3DValueSerializer.cs
- HuffCodec.cs
- ScriptingJsonSerializationSection.cs
- QilIterator.cs
- WrappedKeySecurityToken.cs
- SqlCacheDependencyDatabaseCollection.cs
- FlowDocumentReader.cs
- bidPrivateBase.cs
- DirectoryRedirect.cs
- NativeMethods.cs
- OracleColumn.cs
- IndependentAnimationStorage.cs
- SafeArrayRankMismatchException.cs
- MDIWindowDialog.cs
- milrender.cs
- OutputCacheSection.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- UnsafeNativeMethods.cs
- OdbcConnectionHandle.cs
- XmlDomTextWriter.cs
- WebSysDescriptionAttribute.cs
- RowToParametersTransformer.cs
- DiscreteKeyFrames.cs
- ConfigsHelper.cs
- DoubleAnimationBase.cs
- UIHelper.cs
- DesignRelationCollection.cs
- EventLogInformation.cs
- recordstatefactory.cs
- ListBox.cs
- GridViewRowCollection.cs
- KeyValueConfigurationElement.cs
- ListMarkerLine.cs
- MemberInfoSerializationHolder.cs
- ElementMarkupObject.cs
- WorkflowInstance.cs
- CodeDelegateInvokeExpression.cs
- AssemblyFilter.cs
- XmlWriterSettings.cs
- ConfigurationManagerInternal.cs
- OpacityConverter.cs
- UnsafeNativeMethodsMilCoreApi.cs
- DataGridViewDataConnection.cs
- NavigationPropertySingletonExpression.cs