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 / Input / Command / CanExecuteRoutedEventArgs.cs / 1 / CanExecuteRoutedEventArgs.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Input; namespace System.Windows.Input { ////// Event handler associated with the CanExecute events. /// public delegate void CanExecuteRoutedEventHandler(object sender, CanExecuteRoutedEventArgs e); ////// Event arguments for the CanExecute events. /// public sealed class CanExecuteRoutedEventArgs : RoutedEventArgs { #region Constructors ////// Initializes a new instance of this class. /// /// The command that is being executed. /// The parameter that was passed when executing the command. internal CanExecuteRoutedEventArgs(ICommand command, object parameter) { if (command == null) { throw new ArgumentNullException("command"); } _command = command; _parameter = parameter; } #endregion #region Public Properties ////// The command that could be executed. /// public ICommand Command { get { return _command; } } ////// The parameter passed when considering executing the command. /// public object Parameter { get { return _parameter; } } ////// Whether the command with the specified parameter can be executed. /// public bool CanExecute { get { return _canExecute; } set { _canExecute = value; } } ////// Whether the input event (if any) that caused the command /// should continue its route. /// public bool ContinueRouting { get { return _continueRouting; } set { _continueRouting = value; } } #endregion #region Protected Methods ////// Calls the handler. /// /// Handler delegate to invoke /// Target element protected override void InvokeEventHandler(Delegate genericHandler, object target) { CanExecuteRoutedEventHandler handler = (CanExecuteRoutedEventHandler)genericHandler; handler(target as DependencyObject, this); } #endregion #region Data private ICommand _command; private object _parameter; private bool _canExecute; // Defaults to false private bool _continueRouting; // Defaults to false #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 associated with the CanExecute events. /// public delegate void CanExecuteRoutedEventHandler(object sender, CanExecuteRoutedEventArgs e); ////// Event arguments for the CanExecute events. /// public sealed class CanExecuteRoutedEventArgs : RoutedEventArgs { #region Constructors ////// Initializes a new instance of this class. /// /// The command that is being executed. /// The parameter that was passed when executing the command. internal CanExecuteRoutedEventArgs(ICommand command, object parameter) { if (command == null) { throw new ArgumentNullException("command"); } _command = command; _parameter = parameter; } #endregion #region Public Properties ////// The command that could be executed. /// public ICommand Command { get { return _command; } } ////// The parameter passed when considering executing the command. /// public object Parameter { get { return _parameter; } } ////// Whether the command with the specified parameter can be executed. /// public bool CanExecute { get { return _canExecute; } set { _canExecute = value; } } ////// Whether the input event (if any) that caused the command /// should continue its route. /// public bool ContinueRouting { get { return _continueRouting; } set { _continueRouting = value; } } #endregion #region Protected Methods ////// Calls the handler. /// /// Handler delegate to invoke /// Target element protected override void InvokeEventHandler(Delegate genericHandler, object target) { CanExecuteRoutedEventHandler handler = (CanExecuteRoutedEventHandler)genericHandler; handler(target as DependencyObject, this); } #endregion #region Data private ICommand _command; private object _parameter; private bool _canExecute; // Defaults to false private bool _continueRouting; // Defaults to false #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
- MetadataWorkspace.cs
- oledbmetadatacolumnnames.cs
- OdbcDataAdapter.cs
- DispatcherFrame.cs
- DecoderNLS.cs
- RichTextBoxConstants.cs
- TextEffect.cs
- SignatureHelper.cs
- FieldValue.cs
- NotificationContext.cs
- QilSortKey.cs
- SqlParameterizer.cs
- MediaContextNotificationWindow.cs
- SchemaInfo.cs
- MembershipPasswordException.cs
- ClientCultureInfo.cs
- XmlHierarchyData.cs
- PropertyTab.cs
- InputReferenceExpression.cs
- SliderAutomationPeer.cs
- ExtensionFile.cs
- COM2PictureConverter.cs
- DynamicMethod.cs
- ConstantSlot.cs
- ListViewDesigner.cs
- ToolStripItemEventArgs.cs
- VoiceInfo.cs
- NotImplementedException.cs
- AssociationSetEnd.cs
- ChangesetResponse.cs
- DesignerDataView.cs
- MailHeaderInfo.cs
- ManagementNamedValueCollection.cs
- IntSecurity.cs
- HtmlInputText.cs
- SmtpCommands.cs
- COM2IDispatchConverter.cs
- BaseCodeDomTreeGenerator.cs
- PreviewPrintController.cs
- MissingSatelliteAssemblyException.cs
- ScrollableControl.cs
- FormCollection.cs
- UniqueIdentifierService.cs
- CodeSnippetTypeMember.cs
- SingleAnimation.cs
- CodeVariableReferenceExpression.cs
- AsymmetricKeyExchangeFormatter.cs
- ConfigurationSection.cs
- PolyBezierSegment.cs
- XmlCodeExporter.cs
- Window.cs
- ReaderContextStackData.cs
- TableColumn.cs
- GifBitmapEncoder.cs
- AspProxy.cs
- SmiGettersStream.cs
- WorkflowInspectionServices.cs
- TypeSemantics.cs
- WinEventWrap.cs
- Cursor.cs
- xdrvalidator.cs
- RSAPKCS1KeyExchangeFormatter.cs
- DataFieldConverter.cs
- ObjectConverter.cs
- TextTreeFixupNode.cs
- selecteditemcollection.cs
- NonSerializedAttribute.cs
- _OSSOCK.cs
- DataGridPageChangedEventArgs.cs
- RequestSecurityTokenResponse.cs
- AssociationSetMetadata.cs
- StateRuntime.cs
- Light.cs
- CodeTypeDeclarationCollection.cs
- XslTransformFileEditor.cs
- GridViewRowEventArgs.cs
- SystemBrushes.cs
- CompareValidator.cs
- QueryResult.cs
- WebPartDisplayModeEventArgs.cs
- MemberExpressionHelper.cs
- AmbientProperties.cs
- ContentHostHelper.cs
- X509Chain.cs
- WorkflowServiceBuildProvider.cs
- TypeSystemProvider.cs
- WebService.cs
- SamlAssertion.cs
- MethodCallExpression.cs
- UIElementParagraph.cs
- VoiceObjectToken.cs
- RectValueSerializer.cs
- TimerElapsedEvenArgs.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- Property.cs
- TimeoutException.cs
- GenericsInstances.cs
- OleDbEnumerator.cs
- DesignerView.Commands.cs
- ObjectSet.cs