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
- NavigationPropertyEmitter.cs
- ThaiBuddhistCalendar.cs
- DataGridColumnCollectionEditor.cs
- ConfigurationPermission.cs
- DataException.cs
- HostProtectionPermission.cs
- DeferredBinaryDeserializerExtension.cs
- X509CertificateEndpointIdentity.cs
- TypeToken.cs
- XslException.cs
- ToolStripComboBox.cs
- CheckoutException.cs
- SecondaryViewProvider.cs
- ObjectStorage.cs
- BrushConverter.cs
- SymmetricSecurityBindingElement.cs
- ListViewTableCell.cs
- MDIClient.cs
- CacheDependency.cs
- FixedFindEngine.cs
- TypeElement.cs
- DataGridViewRowPostPaintEventArgs.cs
- ToolStripCollectionEditor.cs
- RootBrowserWindowProxy.cs
- ViewCellSlot.cs
- MimeFormReflector.cs
- shaperfactoryquerycacheentry.cs
- OracleConnection.cs
- TypeUsage.cs
- StringFormat.cs
- SymbolMethod.cs
- ObjectView.cs
- ManualResetEvent.cs
- BamlRecords.cs
- SecurityPermission.cs
- PopupRoot.cs
- TemplateBindingExpression.cs
- RSACryptoServiceProvider.cs
- DataKey.cs
- StartUpEventArgs.cs
- TrackingMemoryStream.cs
- WebPartEditVerb.cs
- InputProviderSite.cs
- PersonalizableAttribute.cs
- RepeatEnumerable.cs
- EncoderParameters.cs
- WindowsStreamSecurityBindingElement.cs
- ControlPropertyNameConverter.cs
- CryptoProvider.cs
- LinqDataSourceSelectEventArgs.cs
- HttpWriter.cs
- SqlDataSourceQueryEditor.cs
- DataGridViewSelectedCellCollection.cs
- ReadOnlyDataSourceView.cs
- Roles.cs
- StatusBarDesigner.cs
- ResponseBodyWriter.cs
- SignatureGenerator.cs
- HtmlShimManager.cs
- SQLByte.cs
- ThreadAbortException.cs
- XmlILStorageConverter.cs
- BackStopAuthenticationModule.cs
- InputElement.cs
- RemoteHelper.cs
- UnmanagedMemoryStream.cs
- InfoCard.cs
- ReachSerializationUtils.cs
- TextElementCollectionHelper.cs
- FormsAuthenticationUserCollection.cs
- TdsParameterSetter.cs
- ToolStripSystemRenderer.cs
- VerificationAttribute.cs
- XmlAttributeAttribute.cs
- SqlUdtInfo.cs
- BamlRecordHelper.cs
- GraphicsContainer.cs
- ItemAutomationPeer.cs
- ProjectionPruner.cs
- LambdaSerializationException.cs
- SendingRequestEventArgs.cs
- JsonFormatWriterGenerator.cs
- NetworkInterface.cs
- Vector3DCollectionConverter.cs
- BufferedWebEventProvider.cs
- FilteredSchemaElementLookUpTable.cs
- MappedMetaModel.cs
- Msec.cs
- ComplexBindingPropertiesAttribute.cs
- HMAC.cs
- WebPartManagerInternals.cs
- XomlCompilerParameters.cs
- IPEndPoint.cs
- HTMLTagNameToTypeMapper.cs
- DataGridToolTip.cs
- UnitySerializationHolder.cs
- HScrollProperties.cs
- AudioFormatConverter.cs
- AppSettingsSection.cs
- ObjectDataSourceWizardForm.cs