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
- AxisAngleRotation3D.cs
- AppAction.cs
- HistoryEventArgs.cs
- WindowInteropHelper.cs
- XmlSchemaDatatype.cs
- UpdatePanelTrigger.cs
- DataControlFieldCollection.cs
- ListViewAutomationPeer.cs
- ProcessModuleCollection.cs
- Expander.cs
- XmlHierarchyData.cs
- tabpagecollectioneditor.cs
- DataBindingCollection.cs
- StickyNoteHelper.cs
- PropertyContainer.cs
- IODescriptionAttribute.cs
- WinEventHandler.cs
- XsdDateTime.cs
- OletxVolatileEnlistment.cs
- PointUtil.cs
- OneWayBindingElement.cs
- FormViewUpdateEventArgs.cs
- HealthMonitoringSectionHelper.cs
- CapacityStreamGeometryContext.cs
- CommandCollectionEditor.cs
- GatewayDefinition.cs
- HexParser.cs
- QilChoice.cs
- ValidatingPropertiesEventArgs.cs
- SqlGenericUtil.cs
- Stack.cs
- SimpleFieldTemplateFactory.cs
- DataGridItemEventArgs.cs
- XmlValueConverter.cs
- ToolBarPanel.cs
- InfoCardUIAgent.cs
- StaticTextPointer.cs
- MissingMethodException.cs
- SignedPkcs7.cs
- FastEncoderWindow.cs
- PeerApplicationLaunchInfo.cs
- ReflectionUtil.cs
- HttpHandler.cs
- AssociatedControlConverter.cs
- InvalidFilterCriteriaException.cs
- MarkupCompilePass1.cs
- lengthconverter.cs
- PreviewPrintController.cs
- PropertyGridCommands.cs
- ExtendLockCommand.cs
- ProcessProtocolHandler.cs
- LayoutTable.cs
- ProfileGroupSettingsCollection.cs
- Guid.cs
- BitmapDecoder.cs
- UserCancellationException.cs
- System.Data.OracleClient_BID.cs
- DateTimeFormatInfoScanner.cs
- TypedReference.cs
- HttpModulesSection.cs
- SubMenuStyleCollection.cs
- Tokenizer.cs
- ExpandCollapseProviderWrapper.cs
- DbConnectionStringCommon.cs
- ReferenceConverter.cs
- WeakReferenceEnumerator.cs
- Label.cs
- TableRow.cs
- Pair.cs
- ActivityBuilderXamlWriter.cs
- DocumentSequence.cs
- FormViewDeletedEventArgs.cs
- CompositionDesigner.cs
- SQLSingleStorage.cs
- LambdaCompiler.Statements.cs
- DynamicValueConverter.cs
- ScriptingJsonSerializationSection.cs
- ButtonField.cs
- CheckBoxPopupAdapter.cs
- FromReply.cs
- MultiPropertyDescriptorGridEntry.cs
- PropertyMapper.cs
- LogLogRecord.cs
- input.cs
- GetWinFXPath.cs
- HotCommands.cs
- LineServices.cs
- WindowsToolbarAsMenu.cs
- SqlDataSourceFilteringEventArgs.cs
- httpapplicationstate.cs
- DesignerToolStripControlHost.cs
- AttributeAction.cs
- SelectorAutomationPeer.cs
- Command.cs
- Nodes.cs
- EmbossBitmapEffect.cs
- TextFragmentEngine.cs
- DetailsViewPagerRow.cs
- TextViewDesigner.cs
- TemplateControlCodeDomTreeGenerator.cs