Esempio n. 1
0
        public void Apply(ICommandParserOptions options, CommandModel model, string[] args, ref int argIndex)
        {
            if (model.GetType() != this.TargetProperty.DeclaringType)
            {
                throw new InvalidOperationException("Incompatible model type.");
            }

            this.DoApply(options, model, args, ref argIndex);
        }
Esempio n. 2
0
        private IReceiver GetReceiverInstance(CommandModel commandModel)
        {
            Type commandType = commandModel.GetType();

            if (_receiverInstances.ContainsKey(commandType))
            {
                return(_receiverInstances[commandType]());
            }
            return(null);
        }
Esempio n. 3
0
 ///<summary>
 /// Returns true if the command instance type match the current type filter.
 ///</summary>
 ///<param name="command">Command to match</param>
 ///<returns>True is match</returns>
 public virtual bool Match(CommandModel command)
 {
     return Match(command.GetType());
 }
Esempio n. 4
0
 ///<summary>
 /// Returns true if the command instance type match the current type filter.
 ///</summary>
 ///<param name="command">Command to match</param>
 ///<returns>True is match</returns>
 public virtual bool Match(CommandModel command)
 {
     return(Match(command.GetType()));
 }