Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / Command / ExecutedRoutedEventArgs.cs / 1305600 / ExecutedRoutedEventArgs.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System;
using System.Windows;
using System.Windows.Input;
namespace System.Windows.Input
{
///
/// Event handler for the Executed events.
///
public delegate void ExecutedRoutedEventHandler(object sender, ExecutedRoutedEventArgs e);
///
/// Event arguments for the Executed events.
///
public sealed class ExecutedRoutedEventArgs : RoutedEventArgs
{
#region Constructor
///
/// Initializes a new instance of this class.
///
/// The command that is being executed.
/// The parameter that was passed when executing the command.
internal ExecutedRoutedEventArgs(ICommand command, object parameter)
{
if (command == null)
{
throw new ArgumentNullException("command");
}
_command = command;
_parameter = parameter;
}
#endregion
#region Public Properties
///
/// The command being executed.
///
public ICommand Command
{
get { return _command; }
}
///
/// The parameter passed when executing the command.
///
public object Parameter
{
get { return _parameter; }
}
#endregion
#region Protected Methods
///
/// Calls the handler.
///
/// Handler delegate to invoke
/// Target element
protected override void InvokeEventHandler(Delegate genericHandler, object target)
{
ExecutedRoutedEventHandler handler = (ExecutedRoutedEventHandler)genericHandler;
handler(target as DependencyObject, this);
}
#endregion
#region Data
private ICommand _command;
private object _parameter;
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System;
using System.Windows;
using System.Windows.Input;
namespace System.Windows.Input
{
///
/// Event handler for the Executed events.
///
public delegate void ExecutedRoutedEventHandler(object sender, ExecutedRoutedEventArgs e);
///
/// Event arguments for the Executed events.
///
public sealed class ExecutedRoutedEventArgs : RoutedEventArgs
{
#region Constructor
///
/// Initializes a new instance of this class.
///
/// The command that is being executed.
/// The parameter that was passed when executing the command.
internal ExecutedRoutedEventArgs(ICommand command, object parameter)
{
if (command == null)
{
throw new ArgumentNullException("command");
}
_command = command;
_parameter = parameter;
}
#endregion
#region Public Properties
///
/// The command being executed.
///
public ICommand Command
{
get { return _command; }
}
///
/// The parameter passed when executing the command.
///
public object Parameter
{
get { return _parameter; }
}
#endregion
#region Protected Methods
///
/// Calls the handler.
///
/// Handler delegate to invoke
/// Target element
protected override void InvokeEventHandler(Delegate genericHandler, object target)
{
ExecutedRoutedEventHandler handler = (ExecutedRoutedEventHandler)genericHandler;
handler(target as DependencyObject, this);
}
#endregion
#region Data
private ICommand _command;
private object _parameter;
#endregion
}
}
// 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
- SplineQuaternionKeyFrame.cs
- XmlSortKey.cs
- ExceptionHandlerDesigner.cs
- ContentDefinition.cs
- GlobalId.cs
- SectionUpdates.cs
- FontCacheLogic.cs
- TdsParserStateObject.cs
- QueryOutputWriter.cs
- TypeReference.cs
- BaseContextMenu.cs
- DbConnectionClosed.cs
- DiscardableAttribute.cs
- PeerCollaborationPermission.cs
- WaitHandle.cs
- SQLBinaryStorage.cs
- XmlEventCache.cs
- FormViewInsertEventArgs.cs
- Logging.cs
- IgnorePropertiesAttribute.cs
- wgx_commands.cs
- InheritedPropertyDescriptor.cs
- EventWaitHandle.cs
- ObjectTypeMapping.cs
- WaveHeader.cs
- ReplacementText.cs
- UnSafeCharBuffer.cs
- DetailsView.cs
- ArgIterator.cs
- SamlConditions.cs
- SqlComparer.cs
- RequestTimeoutManager.cs
- DrawingContext.cs
- BamlStream.cs
- AudioBase.cs
- ZipPackagePart.cs
- PseudoWebRequest.cs
- Encoder.cs
- ProxyDataContractResolver.cs
- ObjectStateManagerMetadata.cs
- TCEAdapterGenerator.cs
- StrongName.cs
- ListView.cs
- DataControlImageButton.cs
- FontResourceCache.cs
- TextViewBase.cs
- DropDownList.cs
- AttributeAction.cs
- SqlClientWrapperSmiStreamChars.cs
- HandlerFactoryCache.cs
- ThreadStartException.cs
- DispatchChannelSink.cs
- SystemEvents.cs
- RootBrowserWindow.cs
- PermissionAttributes.cs
- CommonObjectSecurity.cs
- NativeRecognizer.cs
- ManipulationDevice.cs
- EmbeddedMailObjectsCollection.cs
- BeginStoryboard.cs
- HijriCalendar.cs
- InkCanvas.cs
- MenuStrip.cs
- ProcessHostServerConfig.cs
- RepeaterItemEventArgs.cs
- FixedSOMLineCollection.cs
- TypeExtensionConverter.cs
- XpsFilter.cs
- XmlNamespaceMappingCollection.cs
- XmlLanguage.cs
- StickyNoteAnnotations.cs
- DiagnosticTraceSource.cs
- ProcessModelSection.cs
- InvalidStoreProtectionKeyException.cs
- AccessibleObject.cs
- FormsAuthenticationUser.cs
- GlobalizationSection.cs
- MonikerProxyAttribute.cs
- IntellisenseTextBox.designer.cs
- SQLResource.cs
- ColorContextHelper.cs
- GenericUriParser.cs
- WebPartHeaderCloseVerb.cs
- SkewTransform.cs
- RawStylusActions.cs
- Int16Converter.cs
- XmlWrappingReader.cs
- IndexedString.cs
- OleDbRowUpdatingEvent.cs
- Control.cs
- BoolExpressionVisitors.cs
- DrawingImage.cs
- SqlDataSourceCustomCommandPanel.cs
- ConfigurationManagerInternalFactory.cs
- MaskedTextProvider.cs
- IncomingWebResponseContext.cs
- ChineseLunisolarCalendar.cs
- NonBatchDirectoryCompiler.cs
- Part.cs
- WebBrowserHelper.cs