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
- ClickablePoint.cs
- FieldToken.cs
- HtmlInputSubmit.cs
- ObjectPersistData.cs
- RightsManagementInformation.cs
- HeaderedItemsControl.cs
- ConfigurationElement.cs
- SystemIcmpV4Statistics.cs
- Attributes.cs
- SHA256Managed.cs
- FlowDocumentPageViewerAutomationPeer.cs
- MeasureItemEvent.cs
- ClientSettings.cs
- BuildResult.cs
- LayoutUtils.cs
- SimpleApplicationHost.cs
- CompilationLock.cs
- Timeline.cs
- PropertyCollection.cs
- WorkflowInlining.cs
- SendReply.cs
- MLangCodePageEncoding.cs
- HtmlGenericControl.cs
- CodeNamespaceImportCollection.cs
- CalendarTable.cs
- PropertyDescriptorGridEntry.cs
- TransformConverter.cs
- CustomErrorsSection.cs
- TextUtf8RawTextWriter.cs
- ChameleonKey.cs
- mediaeventshelper.cs
- ControlPager.cs
- Sequence.cs
- Transaction.cs
- AmbientLight.cs
- FastEncoderWindow.cs
- SrgsElementFactoryCompiler.cs
- LinkedList.cs
- FigureHelper.cs
- MemberAccessException.cs
- _OverlappedAsyncResult.cs
- StreamResourceInfo.cs
- InlinedAggregationOperator.cs
- RadioButtonStandardAdapter.cs
- CompilationSection.cs
- RefType.cs
- CalendarDesigner.cs
- ModuleConfigurationInfo.cs
- XamlTreeBuilderBamlRecordWriter.cs
- Monitor.cs
- EnterpriseServicesHelper.cs
- CustomError.cs
- FileFormatException.cs
- GiveFeedbackEventArgs.cs
- CustomAttributeFormatException.cs
- MailAddress.cs
- FramingEncoders.cs
- TextEditorSpelling.cs
- Label.cs
- DataKey.cs
- CompositeDataBoundControl.cs
- PatternMatcher.cs
- ConnectionPoint.cs
- TextSegment.cs
- SqlClientMetaDataCollectionNames.cs
- HashSet.cs
- ZoneIdentityPermission.cs
- DispatcherExceptionFilterEventArgs.cs
- TextDecoration.cs
- RowVisual.cs
- PrinterSettings.cs
- CancelRequestedQuery.cs
- IIS7UserPrincipal.cs
- ConnectionStringSettingsCollection.cs
- SchemaNamespaceManager.cs
- SizeAnimation.cs
- WindowsComboBox.cs
- controlskin.cs
- KnownTypesHelper.cs
- ClientSettingsStore.cs
- TdsParserHelperClasses.cs
- SharedPerformanceCounter.cs
- Configuration.cs
- AssemblyResourceLoader.cs
- PageFunction.cs
- Context.cs
- WindowsComboBox.cs
- CrossSiteScriptingValidation.cs
- Expression.cs
- ConfigXmlComment.cs
- DataBoundControlActionList.cs
- TailPinnedEventArgs.cs
- FormatVersion.cs
- HttpCacheVary.cs
- FixedTextView.cs
- AuthenticationSection.cs
- DataSourceProvider.cs
- StylusPoint.cs
- WindowsListViewGroup.cs
- IpcServerChannel.cs