Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- NodeLabelEditEvent.cs
- StrokeNode.cs
- PerformanceCountersElement.cs
- ProcessInputEventArgs.cs
- SmiTypedGetterSetter.cs
- _AutoWebProxyScriptWrapper.cs
- RelationshipConverter.cs
- ClientRolePrincipal.cs
- ProfileEventArgs.cs
- SoapExtension.cs
- Rotation3DAnimationBase.cs
- CompiledRegexRunnerFactory.cs
- AppSettingsReader.cs
- BitmapEffect.cs
- XmlSchemaInclude.cs
- ObjectListItem.cs
- MatrixCamera.cs
- EnumBuilder.cs
- DocumentPaginator.cs
- __ComObject.cs
- InternalEnumValidatorAttribute.cs
- DynamicILGenerator.cs
- HttpListenerContext.cs
- ProxyGenerator.cs
- BackgroundWorker.cs
- DataGridViewSortCompareEventArgs.cs
- TriggerActionCollection.cs
- Registry.cs
- CodeDelegateCreateExpression.cs
- AnimationException.cs
- ValueUnavailableException.cs
- CompositeTypefaceMetrics.cs
- IteratorAsyncResult.cs
- InsufficientExecutionStackException.cs
- SplayTreeNode.cs
- ItemTypeToolStripMenuItem.cs
- WorkflowOperationBehavior.cs
- Grant.cs
- BackEase.cs
- RoleGroupCollection.cs
- KeyValueInternalCollection.cs
- TextTreeRootTextBlock.cs
- Convert.cs
- _TLSstream.cs
- NonSerializedAttribute.cs
- DataComponentGenerator.cs
- RemoteCryptoTokenProvider.cs
- HashCodeCombiner.cs
- AssertUtility.cs
- XmlDocumentType.cs
- DrawItemEvent.cs
- HtmlAnchor.cs
- XmlAttributeCollection.cs
- CryptoApi.cs
- DoubleAnimation.cs
- ToolboxComponentsCreatingEventArgs.cs
- TextEditorTyping.cs
- Parameter.cs
- CapabilitiesRule.cs
- GuidelineCollection.cs
- Number.cs
- CodePropertyReferenceExpression.cs
- WebBrowserSiteBase.cs
- HuffmanTree.cs
- CompareValidator.cs
- StorageAssociationTypeMapping.cs
- EmptyCollection.cs
- ImageDrawing.cs
- ExpressionNormalizer.cs
- DesignerSerializationOptionsAttribute.cs
- EventLogPermissionHolder.cs
- SrgsElementFactory.cs
- ReliabilityContractAttribute.cs
- StandardCommands.cs
- ListBoxItemAutomationPeer.cs
- HtmlAnchor.cs
- localization.cs
- Trigger.cs
- ListViewItem.cs
- ToolBarTray.cs
- NetworkAddressChange.cs
- HandleCollector.cs
- Certificate.cs
- Helper.cs
- SqlInternalConnection.cs
- StaticTextPointer.cs
- UpdateExpressionVisitor.cs
- PartialTrustVisibleAssemblyCollection.cs
- TemplateControlParser.cs
- DataGridViewSortCompareEventArgs.cs
- TableAdapterManagerGenerator.cs
- TCEAdapterGenerator.cs
- DataControlCommands.cs
- serverconfig.cs
- BindingEditor.xaml.cs
- StorageConditionPropertyMapping.cs
- Oid.cs
- StringUtil.cs
- FixedSOMContainer.cs
- ByteStreamBufferedMessageData.cs