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
- Crc32.cs
- GlyphRunDrawing.cs
- ColumnClickEvent.cs
- KeyFrames.cs
- DataGridTextBox.cs
- SqlTriggerAttribute.cs
- OdbcReferenceCollection.cs
- ThemeableAttribute.cs
- GridViewEditEventArgs.cs
- OrCondition.cs
- ManipulationCompletedEventArgs.cs
- FrameworkElement.cs
- translator.cs
- StandardOleMarshalObject.cs
- ConditionalBranch.cs
- TdsParserStaticMethods.cs
- RectangleGeometry.cs
- ToolStripSystemRenderer.cs
- LineBreak.cs
- BaseCollection.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- ProcessStartInfo.cs
- CfgRule.cs
- WindowsPen.cs
- EncoderParameters.cs
- WebPartTracker.cs
- RepeatInfo.cs
- AsymmetricSignatureDeformatter.cs
- XmlNodeReader.cs
- BaseServiceProvider.cs
- Merger.cs
- ConfigXmlWhitespace.cs
- DataGridViewTopLeftHeaderCell.cs
- AliasedExpr.cs
- ClientSettingsSection.cs
- GradientBrush.cs
- XpsFontSerializationService.cs
- ToggleProviderWrapper.cs
- ConfigsHelper.cs
- Policy.cs
- DocumentViewerConstants.cs
- TimeSpan.cs
- SQLMoneyStorage.cs
- SafeSecurityHandles.cs
- XDRSchema.cs
- EventTrigger.cs
- BitmapEffectGeneralTransform.cs
- WebBrowserSiteBase.cs
- IndexedString.cs
- IRCollection.cs
- ResolveNameEventArgs.cs
- OutputCacheSettingsSection.cs
- CaseInsensitiveHashCodeProvider.cs
- OdbcConnectionString.cs
- InputLangChangeEvent.cs
- RoutedPropertyChangedEventArgs.cs
- ModelItemCollection.cs
- FontStretches.cs
- CodeEventReferenceExpression.cs
- SoapAttributes.cs
- Unit.cs
- DetailsViewRow.cs
- SynchronizedMessageSource.cs
- FileSystemInfo.cs
- IApplicationTrustManager.cs
- MoveSizeWinEventHandler.cs
- DbProviderFactoriesConfigurationHandler.cs
- WebHttpElement.cs
- EntityFunctions.cs
- MulticastNotSupportedException.cs
- RotateTransform3D.cs
- ThreadStateException.cs
- ServiceNameElement.cs
- EntityClientCacheEntry.cs
- OptionalColumn.cs
- QilValidationVisitor.cs
- RegexStringValidatorAttribute.cs
- Attributes.cs
- AddInAttribute.cs
- CodePageUtils.cs
- NotifyInputEventArgs.cs
- MessageProtectionOrder.cs
- CheckBox.cs
- MouseOverProperty.cs
- PlatformNotSupportedException.cs
- DbCommandTree.cs
- GridSplitter.cs
- XmlRootAttribute.cs
- ItemsChangedEventArgs.cs
- XmlCharCheckingReader.cs
- WebServiceParameterData.cs
- ServiceHostingEnvironment.cs
- DesignerSerializationVisibilityAttribute.cs
- PropertyChangedEventArgs.cs
- Stopwatch.cs
- ZipIOFileItemStream.cs
- wgx_exports.cs
- SwitchElementsCollection.cs
- HtmlButton.cs
- ToolStripDropDownItemDesigner.cs