Exemple #1
0
        public static bool TryGetCommand(Type type, Operation operation, out string command)
        {
            command = null;
            var key           = new CommandKey(type, operation);
            var cachedCommand = Cache.FirstOrDefault(x => x.CommandKey.Equals(key));

            if (cachedCommand == null)
            {
                return(false);
            }

            command = cachedCommand.Command;

            return(true);
        }
Exemple #2
0
 public CachedCommand(Type type, Operation operation, string command)
 {
     CommandKey = new CommandKey(type, operation);
     Command    = command;
 }