Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- ApplicationFileParser.cs
- OleDbCommandBuilder.cs
- AttributeCollection.cs
- UriTemplateCompoundPathSegment.cs
- TypeHelper.cs
- EdmProperty.cs
- HttpRequestTraceRecord.cs
- MatchAttribute.cs
- MappingItemCollection.cs
- DefaultPrintController.cs
- xmlsaver.cs
- PropertyValueChangedEvent.cs
- HtmlTitle.cs
- PrintPreviewGraphics.cs
- ExtensibleClassFactory.cs
- StateMachine.cs
- ApplicationFileParser.cs
- ObjectIDGenerator.cs
- RelatedImageListAttribute.cs
- sqlnorm.cs
- BuildManager.cs
- MsmqBindingFilter.cs
- EnumerableValidator.cs
- OdbcDataReader.cs
- Window.cs
- ModuleBuilder.cs
- SharedUtils.cs
- StringInfo.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- AsyncDataRequest.cs
- RepeatButtonAutomationPeer.cs
- TextEditorTables.cs
- ImageAnimator.cs
- DefaultTextStore.cs
- HyperLinkField.cs
- URLMembershipCondition.cs
- ExecutionEngineException.cs
- HandleCollector.cs
- HtmlHead.cs
- WorkflowWebService.cs
- ObjectStateFormatter.cs
- GiveFeedbackEvent.cs
- DataControlFieldHeaderCell.cs
- control.ime.cs
- RequestQueryParser.cs
- DataProtection.cs
- WebConfigurationFileMap.cs
- AnnotationAuthorChangedEventArgs.cs
- StylusPointProperties.cs
- HuffModule.cs
- RuleSet.cs
- NativeMethodsOther.cs
- SqlUnionizer.cs
- DeferredElementTreeState.cs
- HMACSHA384.cs
- TableLayoutSettings.cs
- ConsoleCancelEventArgs.cs
- ObjectPersistData.cs
- ReferenceConverter.cs
- AsyncInvokeContext.cs
- HandleCollector.cs
- DbDataReader.cs
- StylusLogic.cs
- UnionCqlBlock.cs
- LocalizationParserHooks.cs
- EntityType.cs
- SecurityTokenAttachmentMode.cs
- SslStream.cs
- ScriptModule.cs
- PersonalizationProviderCollection.cs
- EntityExpressionVisitor.cs
- ComAdminInterfaces.cs
- AxHost.cs
- HasRunnableWorkflowEvent.cs
- TemplateComponentConnector.cs
- NonNullItemCollection.cs
- TableColumn.cs
- UnsafeCollabNativeMethods.cs
- ScrollContentPresenter.cs
- IISMapPath.cs
- CustomErrorCollection.cs
- Subset.cs
- OracleDataAdapter.cs
- ClientTargetSection.cs
- ProviderCollection.cs
- HttpModuleCollection.cs
- SHA256.cs
- ToolStripContentPanelDesigner.cs
- UpDownBase.cs
- KeyInfo.cs
- AnimatedTypeHelpers.cs
- StringExpressionSet.cs
- TcpWorkerProcess.cs
- PropertyTabChangedEvent.cs
- ComponentEditorPage.cs
- PointF.cs
- SecurityRuntime.cs
- ToolStripOverflow.cs
- PagesSection.cs
- GridView.cs