1 //---------------------------------------------------------------------------
2 //
3 // Copyright (C) Microsoft Corporation.  All rights reserved.
4 //
5 //---------------------------------------------------------------------------
6 
7 using System;
8 using System.ComponentModel;
9 using System.Runtime.CompilerServices;
10 using System.Windows.Markup;
11 
12 namespace System.Windows.Input
13 {
14     class BuildInfo{
15         public const string WCP_VERSION="4.0.0.0";
16         public const string WCP_PUBLIC_KEY_TOKEN="31bf3856ad364e35";
17 
18     }
19     ///<summary>
20     ///     An interface that allows an application author to define a method to be invoked.
21     ///</summary>
22     [TypeForwardedFrom("PresentationCore, Version=" + BuildInfo.WCP_VERSION + ", Culture=neutral, PublicKeyToken=" + BuildInfo.WCP_PUBLIC_KEY_TOKEN)]
23     [TypeConverter("System.Windows.Input.CommandConverter, PresentationFramework, Version=" + BuildInfo.WCP_VERSION + ", Culture=neutral, PublicKeyToken=" + BuildInfo.WCP_PUBLIC_KEY_TOKEN + ", Custom=null")]
24     [ValueSerializer("System.Windows.Input.CommandValueSerializer, PresentationFramework, Version=" + BuildInfo.WCP_VERSION + ", Culture=neutral, PublicKeyToken=" + BuildInfo.WCP_PUBLIC_KEY_TOKEN + ", Custom=null")]
25     public interface ICommand
26     {
27         /// <summary>
28         ///     Raised when the ability of the command to execute has changed.
29         /// </summary>
30         event EventHandler CanExecuteChanged;
31 
32         /// <summary>
33         ///     Returns whether the command can be executed.
34         /// </summary>
35         /// <param name="parameter">A parameter that may be used in executing the command. This parameter may be ignored by some implementations.</param>
36         /// <returns>true if the command can be executed with the given parameter and current state. false otherwise.</returns>
CanExecute(object parameter)37         bool CanExecute(object parameter);
38 
39         /// <summary>
40         ///     Defines the method that should be executed when the command is executed.
41         /// </summary>
42         /// <param name="parameter">A parameter that may be used in executing the command. This parameter may be ignored by some implementations.</param>
Execute(object parameter)43         void Execute(object parameter);
44     }
45 }
46