aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/Command.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-02-10 15:54:50 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2017-02-10 15:54:50 +0100
commit20ca0a729160585ab649da52d3f63bf1dd7ad54c (patch)
tree42dc38f31028f3854f55a8203390ed922dd8cd5a /src/Command.cs
parentff1d0f42b546fec1f45887be8addaa07b9fb5571 (diff)
TextBox, Label, simpler SVG icon for file sys viewers (improve speed a lot), divers debug and code clean
Diffstat (limited to 'src/Command.cs')
-rw-r--r--src/Command.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Command.cs b/src/Command.cs
index f7a12465..1f744f84 100644
--- a/src/Command.cs
+++ b/src/Command.cs
@@ -45,17 +45,17 @@ namespace Crow
string caption;
Picture icon;
- bool isEnabled;
+ bool canExecute = true;
#region Public properties
[XmlAttributeAttribute][DefaultValue(true)]
- public virtual bool IsEnabled {
- get { return isEnabled; }
+ public virtual bool CanExecute {
+ get { return canExecute; }
set {
- if (isEnabled == value)
+ if (canExecute == value)
return;
- isEnabled = value;
- NotifyValueChanged ("IsEnabled", isEnabled);
+ canExecute = value;
+ NotifyValueChanged ("CanExecute", canExecute);
}
}
[XmlAttributeAttribute][DefaultValue("Unamed Command")]
@@ -82,11 +82,11 @@ namespace Crow
#endregion
public void Execute(){
- if (execute != null)
+ if (execute != null && CanExecute)
execute ();
}
internal void raiseAllValuesChanged(){
- NotifyValueChanged ("IsEnabled", isEnabled);
+ NotifyValueChanged ("CanExecute", canExecute);
NotifyValueChanged ("Icon", icon);
NotifyValueChanged ("Caption", caption);
}