Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CmdMessenger"/> class.
        /// </summary>
        /// <param name="client">
        /// The command client.
        /// </param>
        /// <param name="escaping">
        /// The escaping instance.
        /// </param>
        public CmdMessenger(ICmdComms client, IEscaping escaping)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            this.commandHandlers         = new Dictionary <int, List <ICommandObserver> >();
            this.commandTimeOut          = new Timer(this.ProcessTimedOutCommands);
            this.cancellationTokenSource = new CancellationTokenSource();
            this.client = client;
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CmdMessenger"/> class.
 /// </summary>
 /// <param name="client">
 /// The command client.
 /// </param>
 public CmdMessenger(ICmdComms client)
     : this(client, Escaping.Default)
 {
 }