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
- CodeTypeReferenceCollection.cs
- SapiRecoInterop.cs
- UniformGrid.cs
- FutureFactory.cs
- XmlSchemaAnnotation.cs
- FactoryId.cs
- ClientTargetSection.cs
- PointAnimationUsingPath.cs
- XpsException.cs
- InfoCardSymmetricCrypto.cs
- Annotation.cs
- Error.cs
- WebUtil.cs
- SuppressMessageAttribute.cs
- mansign.cs
- RangeBase.cs
- WebSysDescriptionAttribute.cs
- FrameworkContentElement.cs
- RangeBaseAutomationPeer.cs
- DbConnectionStringBuilder.cs
- TerminatorSinks.cs
- AncillaryOps.cs
- HtmlEmptyTagControlBuilder.cs
- QilCloneVisitor.cs
- WebConfigurationFileMap.cs
- WsatServiceCertificate.cs
- BinaryCommonClasses.cs
- CodeAssignStatement.cs
- X509ChainPolicy.cs
- BooleanProjectedSlot.cs
- ChannelManager.cs
- columnmapfactory.cs
- SortedDictionary.cs
- ActivityLocationReferenceEnvironment.cs
- PostBackTrigger.cs
- XsltSettings.cs
- InstanceCreationEditor.cs
- MenuBindingsEditorForm.cs
- VerificationException.cs
- PropertyDescriptorCollection.cs
- SymbolResolver.cs
- DataGridViewCheckBoxColumn.cs
- MetricEntry.cs
- AttributeEmitter.cs
- TraceContextRecord.cs
- NetNamedPipeSecurityMode.cs
- DBConcurrencyException.cs
- _ScatterGatherBuffers.cs
- ServiceHostFactory.cs
- SchemaImporterExtensionElement.cs
- ColumnMapTranslator.cs
- DllNotFoundException.cs
- SymDocumentType.cs
- ColumnMapVisitor.cs
- XmlSchemaChoice.cs
- PrincipalPermission.cs
- safelink.cs
- RuleSettings.cs
- ChangePassword.cs
- EntityRecordInfo.cs
- SqlFacetAttribute.cs
- MarkupWriter.cs
- XmlReader.cs
- SessionState.cs
- CalendarDay.cs
- XmlAttributeAttribute.cs
- RC2.cs
- BuildTopDownAttribute.cs
- XmlChoiceIdentifierAttribute.cs
- GraphicsContext.cs
- RawKeyboardInputReport.cs
- FlowSwitchDesigner.xaml.cs
- BlurBitmapEffect.cs
- ArrangedElement.cs
- GridViewRowCollection.cs
- WindowProviderWrapper.cs
- UnsafeNativeMethodsCLR.cs
- LinearQuaternionKeyFrame.cs
- MimeTypeAttribute.cs
- IriParsingElement.cs
- NavigationExpr.cs
- SafeThreadHandle.cs
- ParagraphResult.cs
- HttpModuleActionCollection.cs
- PersonalizablePropertyEntry.cs
- Soap12ServerProtocol.cs
- COM2ColorConverter.cs
- TextBox.cs
- MenuCommand.cs
- SizeKeyFrameCollection.cs
- InertiaExpansionBehavior.cs
- SqlProcedureAttribute.cs
- IndexedString.cs
- SocketStream.cs
- ResourceFallbackManager.cs
- TraceHandlerErrorFormatter.cs
- RequestDescription.cs
- TransformGroup.cs
- CodeTypeParameterCollection.cs
- InternalResources.cs