Example #1
0
 public AsyncCustomCommand(
     ExecuteAsyncHandler executeAction,
     CanExecuteHandler canExecuteAction = null,
     bool handleExceptions = false,
     ViewModelBase parent  = null,
     bool autoCanExecute   = false,
     string groupName      = null)
     : base(canExecuteAction, handleExceptions, parent, autoCanExecute, groupName)
 {
     executeAction.NotNull("execute");
     ExecuteAsyncAction = executeAction;
 }
Example #2
0
        public Client(string hostname, ProtocolType protocolType = ProtocolType.Udp)
        {
            this.hostname = hostname;
            switch (protocolType)
            {
            case ProtocolType.Udp:
                this.ExecuteAutoAsync = this.ExecuteUDPAsync;
                break;

            case ProtocolType.Tcp:
                this.ExecuteAutoAsync = this.ExecuteTCPAsync;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(protocolType));
            }
        }