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); }
private IReceiver GetReceiverInstance(CommandModel commandModel) { Type commandType = commandModel.GetType(); if (_receiverInstances.ContainsKey(commandType)) { return(_receiverInstances[commandType]()); } return(null); }
///<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()); }
///<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())); }