예제 #1
0
        /// <summary>
        /// Creates a new instance with a specified command handler and prompt string
        /// </summary>
        /// <param name="cmdHandler"></param>
        /// <param name="prompt"></param>
        public CmdWatcher(ICmdCommandHandler cmdHandler, string prompt = null)
        {
            if (cmdHandler == null)
            {
                throw new ArgumentNullException("CmdCommandHandler cannot be null!");
            }

            this.CmdHandler = cmdHandler;

            this.Prompt = prompt ?? DefaultPrompt;
        }
예제 #2
0
 /// <summary>
 /// Creates a new instance with a specified command handler
 /// </summary>
 /// <param name="cmdHandler"></param>
 public CmdWatcher(ICmdCommandHandler cmdHandler)
     : this(cmdHandler, DefaultPrompt)
 {
 }