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
- Substitution.cs
- RadioButtonStandardAdapter.cs
- WebPartEditVerb.cs
- Publisher.cs
- TreeNodeCollection.cs
- ClientFormsAuthenticationMembershipProvider.cs
- SqlConnectionString.cs
- InkCanvasSelectionAdorner.cs
- ServiceDiscoveryElement.cs
- ProfileBuildProvider.cs
- DefaultEventAttribute.cs
- LabelEditEvent.cs
- InlineCategoriesDocument.cs
- RectAnimationBase.cs
- NetNamedPipeBindingCollectionElement.cs
- XmlSchemaAll.cs
- ConnectorRouter.cs
- SmtpMail.cs
- FontStretchConverter.cs
- ProviderMetadataCachedInformation.cs
- MarkupCompiler.cs
- ComplexTypeEmitter.cs
- TextTreeRootTextBlock.cs
- DoubleLinkList.cs
- TableCell.cs
- OletxDependentTransaction.cs
- PaginationProgressEventArgs.cs
- AnimationClockResource.cs
- StringKeyFrameCollection.cs
- ToolboxBitmapAttribute.cs
- OleDbRowUpdatedEvent.cs
- ExpandCollapseProviderWrapper.cs
- ImpersonationContext.cs
- TypeConvertions.cs
- FacetEnabledSchemaElement.cs
- FixUp.cs
- TypeUsageBuilder.cs
- DocumentViewerHelper.cs
- DelayedRegex.cs
- COM2EnumConverter.cs
- DataGridViewComboBoxColumn.cs
- TemplateEditingFrame.cs
- ConnectionManager.cs
- Soap.cs
- WebControl.cs
- LinqDataSourceHelper.cs
- isolationinterop.cs
- CompositeDataBoundControl.cs
- EntityTransaction.cs
- ComponentEditorPage.cs
- LoopExpression.cs
- ButtonDesigner.cs
- LinearGradientBrush.cs
- VectorConverter.cs
- TakeOrSkipQueryOperator.cs
- _NativeSSPI.cs
- ResourceAssociationSetEnd.cs
- AnimatedTypeHelpers.cs
- MetafileHeader.cs
- ValueQuery.cs
- MaskInputRejectedEventArgs.cs
- SortQuery.cs
- OleDbCommandBuilder.cs
- IgnorePropertiesAttribute.cs
- SmiMetaDataProperty.cs
- HitTestWithGeometryDrawingContextWalker.cs
- CompositeFontInfo.cs
- WinInetCache.cs
- PropertyPathWorker.cs
- Validator.cs
- DateTimeFormatInfoScanner.cs
- _Events.cs
- XmlSchemaChoice.cs
- InvalidPrinterException.cs
- PerspectiveCamera.cs
- WindowHideOrCloseTracker.cs
- LinkButton.cs
- FixedSOMFixedBlock.cs
- ClaimSet.cs
- QuadraticBezierSegment.cs
- Attribute.cs
- BitmapEffectInput.cs
- MimeObjectFactory.cs
- TypefaceMap.cs
- ImageField.cs
- Vector3DCollection.cs
- FocusManager.cs
- FunctionDescription.cs
- SiteMapNode.cs
- EventLogRecord.cs
- SqlBulkCopyColumnMapping.cs
- WorkingDirectoryEditor.cs
- VisualProxy.cs
- ThemeDictionaryExtension.cs
- TargetConverter.cs
- ModulesEntry.cs
- InstanceDescriptor.cs
- URI.cs
- NamespaceListProperty.cs
- GraphicsPath.cs