Exemplo n.º 1
0
        public AppViewModel()
        {
            RserveClient = new RserveConnection();
            CreateDesign();

            InitHandlers();
            InitViewMode();
            InitCommands();
        }
Exemplo n.º 2
0
        //public static readonly TimeSpan DefaultTimeOut = TimeSpan.FromMinutes(1);
        private static RserveConnection NewConnection()
        {
            var waitHandle = new AutoResetEvent(false);
            var connection = new RserveConnection();

            connection.Connect((connectionState_, socketError_) => waitHandle.Set());
            waitHandle.WaitOne(DefaultTimeOut);

            if (connection.ConnectionState != ConnectionState.Connected)
            {
                throw new Exception("Connection failure");
            }

            return connection;
        }