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
- ColorBlend.cs
- ApplicationFileCodeDomTreeGenerator.cs
- TextSelection.cs
- HttpWebRequest.cs
- RepeatBehaviorConverter.cs
- PowerStatus.cs
- XamlPointCollectionSerializer.cs
- xsdvalidator.cs
- NamespaceEmitter.cs
- VisualStateGroup.cs
- HashMembershipCondition.cs
- TrackingMemoryStream.cs
- BulletChrome.cs
- HttpListenerTimeoutManager.cs
- TextDocumentView.cs
- EntityContainerEntitySet.cs
- Binding.cs
- EndpointAddressMessageFilterTable.cs
- PageParserFilter.cs
- TextHintingModeValidation.cs
- FontUnit.cs
- Font.cs
- ConfigurationLoaderException.cs
- ReadOnlyActivityGlyph.cs
- HtmlInputControl.cs
- FillErrorEventArgs.cs
- XhtmlBasicCalendarAdapter.cs
- DtrList.cs
- HttpApplicationStateBase.cs
- MediaSystem.cs
- PKCS1MaskGenerationMethod.cs
- Int16.cs
- SaveFileDialog.cs
- FileLogRecordEnumerator.cs
- ObjectConverter.cs
- DataSourceXmlSerializer.cs
- DocumentGrid.cs
- Matrix.cs
- TextTreeUndoUnit.cs
- EditorPartChrome.cs
- ReaderContextStackData.cs
- PrincipalPermission.cs
- WindowsPrincipal.cs
- HelpProvider.cs
- ArrayWithOffset.cs
- GenericWebPart.cs
- ConfigXmlAttribute.cs
- WaitForChangedResult.cs
- BatchStream.cs
- VectorCollectionConverter.cs
- NamespaceEmitter.cs
- hresults.cs
- CfgSemanticTag.cs
- MaskedTextBoxTextEditorDropDown.cs
- ColorConvertedBitmap.cs
- XamlRtfConverter.cs
- TraceFilter.cs
- AppSettingsExpressionBuilder.cs
- RTLAwareMessageBox.cs
- PropertyMetadata.cs
- IndentedTextWriter.cs
- ResumeStoryboard.cs
- FormsAuthenticationTicket.cs
- TimeSpanStorage.cs
- XmlSchemaFacet.cs
- CollectionConverter.cs
- SynchronizationContext.cs
- TimeSpanMinutesConverter.cs
- uribuilder.cs
- DBBindings.cs
- BoundField.cs
- DictionarySectionHandler.cs
- ClockController.cs
- NavigationFailedEventArgs.cs
- ManagedIStream.cs
- StringCollection.cs
- QueryCacheManager.cs
- PathFigure.cs
- SchemaMerger.cs
- DataGrid.cs
- SchemaRegistration.cs
- ProfileService.cs
- UnsafeNativeMethods.cs
- DBNull.cs
- BigInt.cs
- EntityContainerEmitter.cs
- PersianCalendar.cs
- PeerApplication.cs
- EastAsianLunisolarCalendar.cs
- ContextMenu.cs
- WebScriptEnablingBehavior.cs
- _LocalDataStoreMgr.cs
- FixedLineResult.cs
- TimeBoundedCache.cs
- WebPartUserCapability.cs
- StringDictionary.cs
- FormsAuthenticationCredentials.cs
- BitmapSource.cs
- CompatibleComparer.cs
- SettingsAttributeDictionary.cs