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
- MatrixUtil.cs
- BitmapEffectDrawingContent.cs
- DataBindingList.cs
- util.cs
- TdsParserHelperClasses.cs
- GeneralTransform3DTo2DTo3D.cs
- ConnectionStringsExpressionBuilder.cs
- BlockUIContainer.cs
- DbParameterCollectionHelper.cs
- WebConfigurationFileMap.cs
- DecoderReplacementFallback.cs
- CodeMethodInvokeExpression.cs
- ParseChildrenAsPropertiesAttribute.cs
- EventSinkHelperWriter.cs
- QueryResponse.cs
- SqlDeflator.cs
- SlotInfo.cs
- TextTreeText.cs
- ApplicationSettingsBase.cs
- Point3DConverter.cs
- PKCS1MaskGenerationMethod.cs
- SoapReflector.cs
- ListViewPagedDataSource.cs
- ControlBuilder.cs
- ListControlStringCollectionEditor.cs
- Iis7Helper.cs
- CachedFontFamily.cs
- FloatUtil.cs
- SymDocumentType.cs
- Helper.cs
- CodeTypeReferenceExpression.cs
- SwitchAttribute.cs
- ContextMenuStripGroup.cs
- SqlDataSourceSelectingEventArgs.cs
- Mutex.cs
- Selection.cs
- TypeHelpers.cs
- TimeStampChecker.cs
- DataAdapter.cs
- DataServiceBuildProvider.cs
- ComboBox.cs
- HtmlContainerControl.cs
- SamlDoNotCacheCondition.cs
- ServiceBusyException.cs
- WebBrowserNavigatingEventHandler.cs
- ListViewUpdatedEventArgs.cs
- NavigateEvent.cs
- ConfigurationCollectionAttribute.cs
- ListBox.cs
- GetWinFXPath.cs
- MSHTMLHost.cs
- ScrollViewerAutomationPeer.cs
- Italic.cs
- RewritingPass.cs
- HMACMD5.cs
- MergeExecutor.cs
- StrongBox.cs
- XmlNamespaceMappingCollection.cs
- ExceptionUtil.cs
- PrintPageEvent.cs
- coordinatorscratchpad.cs
- DataGridAddNewRow.cs
- Certificate.cs
- TagMapCollection.cs
- ButtonChrome.cs
- XmlSchemaType.cs
- SecureUICommand.cs
- SparseMemoryStream.cs
- ExpanderAutomationPeer.cs
- CfgParser.cs
- EdmEntityTypeAttribute.cs
- MSHTMLHostUtil.cs
- ToolStripItemGlyph.cs
- GridViewPageEventArgs.cs
- WindowsListViewGroupSubsetLink.cs
- TranslateTransform.cs
- storepermission.cs
- Evaluator.cs
- GradientBrush.cs
- CustomCredentialPolicy.cs
- ListSortDescriptionCollection.cs
- ImageAnimator.cs
- COM2Enum.cs
- CollectionDataContract.cs
- FactoryGenerator.cs
- Crc32.cs
- Metadata.cs
- TextDecorationCollectionConverter.cs
- ValidationErrorCollection.cs
- CompositionAdorner.cs
- NextPreviousPagerField.cs
- RuntimeResourceSet.cs
- BaseTemplateCodeDomTreeGenerator.cs
- Trigger.cs
- DataKey.cs
- HScrollBar.cs
- ControlBuilder.cs
- HistoryEventArgs.cs
- PhonemeConverter.cs
- MediaSystem.cs