Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // // 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
- WindowsToolbarAsMenu.cs
- InterleavedZipPartStream.cs
- XmlCustomFormatter.cs
- ModifiableIteratorCollection.cs
- GuidelineSet.cs
- UnmanagedMemoryStreamWrapper.cs
- EffectiveValueEntry.cs
- AppDomainCompilerProxy.cs
- ProfileSettingsCollection.cs
- ItemType.cs
- ProfileServiceManager.cs
- WindowsRegion.cs
- _AuthenticationState.cs
- Deserializer.cs
- TransformProviderWrapper.cs
- CodeAccessSecurityEngine.cs
- DetailsView.cs
- ParseChildrenAsPropertiesAttribute.cs
- _SafeNetHandles.cs
- SuppressIldasmAttribute.cs
- GroupItemAutomationPeer.cs
- WindowAutomationPeer.cs
- OletxEnlistment.cs
- FieldInfo.cs
- DeleteIndexBinder.cs
- GenericPrincipal.cs
- Int16Animation.cs
- HttpHandlerActionCollection.cs
- SqlDataSourceCache.cs
- GregorianCalendarHelper.cs
- PlaceHolder.cs
- NetMsmqBindingCollectionElement.cs
- CreateDataSourceDialog.cs
- UriTemplateTableMatchCandidate.cs
- DataControlLinkButton.cs
- DefaultValueAttribute.cs
- StickyNoteAnnotations.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- StrongNameMembershipCondition.cs
- DiagnosticsElement.cs
- SelectionPatternIdentifiers.cs
- PackUriHelper.cs
- SystemEvents.cs
- Mapping.cs
- Automation.cs
- HostingEnvironmentException.cs
- PageParser.cs
- TaskHelper.cs
- SmtpReplyReaderFactory.cs
- mongolianshape.cs
- WmlImageAdapter.cs
- XamlWriterExtensions.cs
- CursorConverter.cs
- WaitForChangedResult.cs
- CheckBox.cs
- MessageHeaders.cs
- BuildResultCache.cs
- TraceSwitch.cs
- EventTrigger.cs
- SmtpDateTime.cs
- TextSegment.cs
- TransformedBitmap.cs
- Base64WriteStateInfo.cs
- MouseEventArgs.cs
- RecognizerBase.cs
- DataGridRelationshipRow.cs
- TextBox.cs
- GlobalProxySelection.cs
- PageCache.cs
- CanonicalXml.cs
- TerminatorSinks.cs
- ColorMap.cs
- ConstraintStruct.cs
- CatalogPartChrome.cs
- HandleCollector.cs
- QueryPrefixOp.cs
- ExpressionBuilder.cs
- CasesDictionary.cs
- LookupBindingPropertiesAttribute.cs
- PropagatorResult.cs
- Model3DCollection.cs
- RpcCryptoContext.cs
- TableSectionStyle.cs
- ToolStripGrip.cs
- AttributeEmitter.cs
- QueryContinueDragEvent.cs
- FtpWebResponse.cs
- ClientSettingsStore.cs
- MetadataPropertyvalue.cs
- IteratorFilter.cs
- ContainerParaClient.cs
- DataControlPagerLinkButton.cs
- StretchValidation.cs
- IndentedTextWriter.cs
- DocumentXmlWriter.cs
- COM2Enum.cs
- PopOutPanel.cs
- SynchronizationValidator.cs
- WebPartCatalogAddVerb.cs
- DataGrid.cs