Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- _SslSessionsCache.cs
- DynamicMethod.cs
- InheritanceService.cs
- BaseValidator.cs
- Literal.cs
- safelinkcollection.cs
- ObjRef.cs
- RecommendedAsConfigurableAttribute.cs
- ComboBoxRenderer.cs
- UIElementAutomationPeer.cs
- MasterPageBuildProvider.cs
- ProcessProtocolHandler.cs
- ContractMapping.cs
- StyleHelper.cs
- AdornerHitTestResult.cs
- DashStyle.cs
- SafeRightsManagementQueryHandle.cs
- FacetEnabledSchemaElement.cs
- TrackBar.cs
- Decoder.cs
- SerialErrors.cs
- ExpressionVisitorHelpers.cs
- DocumentSequenceHighlightLayer.cs
- DropShadowEffect.cs
- PageMediaType.cs
- StaticExtensionConverter.cs
- FocusChangedEventArgs.cs
- XmlSchemaCompilationSettings.cs
- Utils.cs
- DataError.cs
- HitTestResult.cs
- IssuanceLicense.cs
- RegexRunner.cs
- MetadataArtifactLoader.cs
- PointKeyFrameCollection.cs
- ContentIterators.cs
- GcSettings.cs
- BamlTreeMap.cs
- GlyphManager.cs
- EventWaitHandle.cs
- ReferencedCollectionType.cs
- ServerValidateEventArgs.cs
- WebDisplayNameAttribute.cs
- MobileControlDesigner.cs
- CacheEntry.cs
- SchemaNotation.cs
- InvalidPropValue.cs
- QueryReaderSettings.cs
- StylusTip.cs
- PrimitiveType.cs
- OleDbPermission.cs
- TreeNodeBindingCollection.cs
- connectionpool.cs
- UnionExpr.cs
- odbcmetadatacolumnnames.cs
- AppDomainProtocolHandler.cs
- peernodeimplementation.cs
- PeerToPeerException.cs
- MatrixAnimationBase.cs
- ActiveDocumentEvent.cs
- AnimationStorage.cs
- TemplateEditingService.cs
- HttpCacheParams.cs
- DrawingContextDrawingContextWalker.cs
- SchemeSettingElement.cs
- StorageAssociationSetMapping.cs
- WindowsStreamSecurityElement.cs
- DesignerLabelAdapter.cs
- Accessible.cs
- Camera.cs
- WebRequestModuleElementCollection.cs
- XMLDiffLoader.cs
- VerticalAlignConverter.cs
- TickBar.cs
- SessionEndingCancelEventArgs.cs
- TemplateXamlParser.cs
- TraceSection.cs
- ConstantCheck.cs
- Adorner.cs
- WriteTimeStream.cs
- FormDocumentDesigner.cs
- ListBoxItemAutomationPeer.cs
- UpdateDelegates.Generated.cs
- Semaphore.cs
- EncoderFallback.cs
- MatrixKeyFrameCollection.cs
- SemanticTag.cs
- CalendarModeChangedEventArgs.cs
- HttpCapabilitiesBase.cs
- ThreadBehavior.cs
- COM2IPerPropertyBrowsingHandler.cs
- SegmentInfo.cs
- BuildManagerHost.cs
- IgnoreSectionHandler.cs
- PolyBezierSegment.cs
- ToolStripSettings.cs
- SamlAssertionKeyIdentifierClause.cs
- StructuralCache.cs
- PersonalizableTypeEntry.cs
- MergeFailedEvent.cs