Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / Command / CanExecuteRoutedEventArgs.cs / 1305600 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MailDefinition.cs
- SessionViewState.cs
- PiiTraceSource.cs
- SafeNativeMethods.cs
- listitem.cs
- SmiContext.cs
- XComponentModel.cs
- StoryFragments.cs
- WebHttpSecurity.cs
- ListSourceHelper.cs
- SHA384Managed.cs
- SafeHandle.cs
- WebPartDescription.cs
- WhereQueryOperator.cs
- CqlGenerator.cs
- PingReply.cs
- XmlSchemaCompilationSettings.cs
- TextTreeFixupNode.cs
- HttpProfileGroupBase.cs
- XPathExpr.cs
- ApplicationServiceManager.cs
- QueryOptionExpression.cs
- ScrollableControl.cs
- FaultDescriptionCollection.cs
- SqlConnection.cs
- InfoCard.cs
- HttpRawResponse.cs
- Block.cs
- BinaryQueryOperator.cs
- SchemaManager.cs
- ConditionalBranch.cs
- BitmapEffectInputData.cs
- WebPartConnectionCollection.cs
- DialogResultConverter.cs
- MouseDevice.cs
- EntityDataSourceContextDisposingEventArgs.cs
- TreeNodeEventArgs.cs
- ToggleProviderWrapper.cs
- CriticalExceptions.cs
- ScrollItemProviderWrapper.cs
- CodeCompileUnit.cs
- OdbcEnvironment.cs
- ControlParser.cs
- _SecureChannel.cs
- MessageQueueEnumerator.cs
- Font.cs
- BufferedOutputStream.cs
- SpecialNameAttribute.cs
- TrackBar.cs
- SQLDecimalStorage.cs
- FileLevelControlBuilderAttribute.cs
- Int32AnimationUsingKeyFrames.cs
- ConnectionInterfaceCollection.cs
- SecUtil.cs
- PeerDuplexChannel.cs
- RectIndependentAnimationStorage.cs
- SEHException.cs
- XmlBaseReader.cs
- SelectedDatesCollection.cs
- PartitionResolver.cs
- SchemaType.cs
- CompiledQuery.cs
- Automation.cs
- MultiAsyncResult.cs
- HtmlCommandAdapter.cs
- DigitShape.cs
- MenuAutomationPeer.cs
- BufferedStream2.cs
- Model3DGroup.cs
- HtmlInputSubmit.cs
- MetadataPropertyAttribute.cs
- ChangeInterceptorAttribute.cs
- RoutingConfiguration.cs
- MultipleViewProviderWrapper.cs
- TaskFactory.cs
- UserThread.cs
- QilReplaceVisitor.cs
- ELinqQueryState.cs
- DrawingContextDrawingContextWalker.cs
- ClientCultureInfo.cs
- SelectionManager.cs
- safesecurityhelperavalon.cs
- AsymmetricAlgorithm.cs
- NavigationProgressEventArgs.cs
- SimpleTextLine.cs
- CodeRegionDirective.cs
- GifBitmapDecoder.cs
- NativeBuffer.cs
- TransformConverter.cs
- Stack.cs
- WpfGeneratedKnownTypes.cs
- ProcessModelSection.cs
- ToolboxDataAttribute.cs
- IIS7WorkerRequest.cs
- FixedFindEngine.cs
- UserControlBuildProvider.cs
- LayoutTableCell.cs
- ButtonBaseAutomationPeer.cs
- UIElementPropertyUndoUnit.cs
- ServiceProviders.cs