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
- RegexWorker.cs
- COM2PropertyPageUITypeConverter.cs
- InputBindingCollection.cs
- ReadOnlyTernaryTree.cs
- EpmSyndicationContentSerializer.cs
- RelationshipFixer.cs
- GeneralTransformCollection.cs
- ProcessInputEventArgs.cs
- ModelTreeEnumerator.cs
- GeneralTransform2DTo3D.cs
- CipherData.cs
- ObjectListSelectEventArgs.cs
- ServiceHttpModule.cs
- DesignerObject.cs
- ExpressionEditorAttribute.cs
- FilterEventArgs.cs
- Brush.cs
- PropertyDescriptorComparer.cs
- DebuggerAttributes.cs
- CopyCodeAction.cs
- EncoderParameters.cs
- ListItemParagraph.cs
- ObjectSpanRewriter.cs
- DataShape.cs
- DirectoryNotFoundException.cs
- TimerElapsedEvenArgs.cs
- Identifier.cs
- DispatcherHooks.cs
- EpmAttributeNameBuilder.cs
- EntityDataSourceChangingEventArgs.cs
- FloatSumAggregationOperator.cs
- HttpListenerPrefixCollection.cs
- OperationAbortedException.cs
- XmlSchemaInclude.cs
- SqlDataRecord.cs
- NullableFloatMinMaxAggregationOperator.cs
- DiscoveryClientChannelFactory.cs
- HtmlInputButton.cs
- PageVisual.cs
- TextTabProperties.cs
- ApplyTemplatesAction.cs
- XmlDictionary.cs
- SchemaCollectionPreprocessor.cs
- TextLineBreak.cs
- GenericUriParser.cs
- OracleException.cs
- SynthesizerStateChangedEventArgs.cs
- PageSetupDialog.cs
- FontFamilyValueSerializer.cs
- SafeRegistryHandle.cs
- SqlDelegatedTransaction.cs
- DataGridViewSortCompareEventArgs.cs
- DateTimeConverter.cs
- InputBindingCollection.cs
- HostingPreferredMapPath.cs
- BaseTemplateBuildProvider.cs
- NativeCppClassAttribute.cs
- EraserBehavior.cs
- TypeListConverter.cs
- UpdateException.cs
- DataObjectMethodAttribute.cs
- ParserStreamGeometryContext.cs
- TemplateBuilder.cs
- SafeFindHandle.cs
- ADConnectionHelper.cs
- SchemaImporterExtensionsSection.cs
- SubclassTypeValidator.cs
- GridViewCommandEventArgs.cs
- HttpCapabilitiesBase.cs
- TdsParserHelperClasses.cs
- UInt32Storage.cs
- BaseTemplateParser.cs
- EmptyControlCollection.cs
- prefixendpointaddressmessagefiltertable.cs
- Int64Animation.cs
- GregorianCalendarHelper.cs
- IndexedGlyphRun.cs
- PopupRootAutomationPeer.cs
- XmlSchemaAppInfo.cs
- EdmTypeAttribute.cs
- arabicshape.cs
- RouteParser.cs
- HtmlInputControl.cs
- DrawTreeNodeEventArgs.cs
- SafeSecurityHelper.cs
- MarkupCompilePass1.cs
- XComponentModel.cs
- MergeFilterQuery.cs
- RNGCryptoServiceProvider.cs
- StringFunctions.cs
- GenericTypeParameterBuilder.cs
- IdentityHolder.cs
- MethodToken.cs
- VectorCollectionConverter.cs
- Operand.cs
- RepeatButtonAutomationPeer.cs
- DecimalConstantAttribute.cs
- MobileCategoryAttribute.cs
- AsynchronousChannel.cs
- AssertFilter.cs