Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- EventTrigger.cs
- DesignOnlyAttribute.cs
- ChildrenQuery.cs
- DoWorkEventArgs.cs
- ToolBarOverflowPanel.cs
- DbParameterCollectionHelper.cs
- XmlDataDocument.cs
- Attribute.cs
- ReflectionTypeLoadException.cs
- LayoutUtils.cs
- UiaCoreApi.cs
- ReachPageContentCollectionSerializer.cs
- MergeFilterQuery.cs
- ConfigurationSection.cs
- FileDialogCustomPlace.cs
- WebBrowserEvent.cs
- ListControlBoundActionList.cs
- ConnectivityStatus.cs
- XmlSchemaSimpleType.cs
- DataControlFieldCollection.cs
- TextOutput.cs
- PermissionSetTriple.cs
- OperatingSystem.cs
- LoadRetryHandler.cs
- ArgumentFixer.cs
- DeviceSpecificDialogCachedState.cs
- WindowHideOrCloseTracker.cs
- _NegotiateClient.cs
- PropertyIDSet.cs
- FloaterBaseParaClient.cs
- MaskedTextBox.cs
- SqlAliaser.cs
- EastAsianLunisolarCalendar.cs
- HtmlHistory.cs
- QueryOpeningEnumerator.cs
- DatagridviewDisplayedBandsData.cs
- RotateTransform3D.cs
- StrongNameIdentityPermission.cs
- Point3DValueSerializer.cs
- OdbcDataReader.cs
- OrderedDictionary.cs
- KeyToListMap.cs
- OdbcReferenceCollection.cs
- MsmqHostedTransportManager.cs
- NotFiniteNumberException.cs
- StylusPointPropertyUnit.cs
- DataGridItemAutomationPeer.cs
- TableCell.cs
- ThicknessAnimationUsingKeyFrames.cs
- TransformPattern.cs
- CngProperty.cs
- CurrentChangedEventManager.cs
- BaseProcessor.cs
- RegexStringValidatorAttribute.cs
- GeometryConverter.cs
- XmlSchemaObject.cs
- DescendentsWalker.cs
- ListDictionary.cs
- Viewport3DAutomationPeer.cs
- StringValidator.cs
- SecurityListenerSettingsLifetimeManager.cs
- RectAnimation.cs
- VisualStyleRenderer.cs
- RoutedEventArgs.cs
- QueryContinueDragEventArgs.cs
- AdRotatorDesigner.cs
- Random.cs
- GuidConverter.cs
- OutputCacheProfileCollection.cs
- DataGridCellEditEndingEventArgs.cs
- CreateUserWizard.cs
- Formatter.cs
- OleDbWrapper.cs
- MessagePropertyDescriptionCollection.cs
- UnauthorizedAccessException.cs
- Statements.cs
- ping.cs
- KeySplineConverter.cs
- GroupDescription.cs
- Comparer.cs
- Serializer.cs
- storepermission.cs
- ConditionBrowserDialog.cs
- EnumCodeDomSerializer.cs
- CryptoApi.cs
- GeneralTransform3DGroup.cs
- XamlFxTrace.cs
- Subtree.cs
- ContentFileHelper.cs
- XmlDataSourceView.cs
- XXXOnTypeBuilderInstantiation.cs
- Timer.cs
- JpegBitmapEncoder.cs
- TabControl.cs
- SafeSecurityHelper.cs
- MenuItemCollectionEditor.cs
- ErrorEventArgs.cs
- DataBindingValueUIHandler.cs
- SafeCertificateStore.cs
- CodeAssignStatement.cs