Ignore:
Timestamp:
Aug 4, 2011, 5:34:52 PM (13 years ago)
Author:
bayral
Message:

firsts steps of wpf client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdBase.cs

    r11904 r11905  
    44using System.Text;
    55using System.Windows.Input;
     6using Com.Piwigo.Wpf.Helper;
     7using Com.Piwigo.Wpf.DTO;
    68
    79namespace Com.Piwigo.Wpf.Command
    810{
    9     public abstract class PwgCmdBase :  ICommand
     11    public abstract class PwgCmdBase : ICommand
    1012    {
     13       Boolean _isRunning;
     14       public Boolean IsRunning {
     15           get
     16           {
     17               return _isRunning;
     18           }
     19           set
     20           {
     21               _isRunning = value;
     22           }
     23       }
    1124
    1225       #region ICommand Membres
     26        public virtual bool CanExecute(object parameter)
     27        {
     28             Boolean retVal = false;
     29            if ( AppHelper.IsInDesignModeStatic == true)
     30            {
     31                retVal = false;
     32            }
     33            else
     34            {
     35                if (IsRunning)
     36                {
     37                    retVal = false;
     38                }
     39                else if (PwgModelManager.Instance.Session != null)
     40                {
     41                    retVal = !String.IsNullOrWhiteSpace(PwgModelManager.Instance.Session.ServeurName);                   
     42                }
     43            }
     44            return (retVal);
     45        }
    1346
    14        public abstract  bool CanExecute(object parameter);
    15 
    16        public abstract void Execute(object parameter);
     47        public abstract void Execute(object parameter);
    1748       
    1849        public event EventHandler CanExecuteChanged
    19        {
     50        {
    2051           add { CommandManager.RequerySuggested += value; }
    2152           remove { CommandManager.RequerySuggested -= value; }
    22        }
     53        }
    2354       #endregion
    2455    }
Note: See TracChangeset for help on using the changeset viewer.