Ejemplo 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);
        }
Ejemplo n.º 2
0
        private IReceiver GetReceiverInstance(CommandModel commandModel)
        {
            Type commandType = commandModel.GetType();

            if (_receiverInstances.ContainsKey(commandType))
            {
                return(_receiverInstances[commandType]());
            }
            return(null);
        }
Ejemplo 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());
 }
Ejemplo 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()));
 }