示例#1
0
        private int AdjustValue(int adjust, Microsoft.AspNet.SignalR.Client.ConnectionState state)
        {
            lock (labelLock)
            {
                if (state == Microsoft.AspNet.SignalR.Client.ConnectionState.Connecting)
                {
                    _counter.connecting = _counter.connecting + adjust;
                    return(_counter.connecting);
                }
                if (state == Microsoft.AspNet.SignalR.Client.ConnectionState.Connected)
                {
                    _counter.connected = _counter.connected + adjust;
                    return(_counter.connected);
                }
                if (state == Microsoft.AspNet.SignalR.Client.ConnectionState.Reconnecting)
                {
                    _counter.reconnecting = _counter.reconnecting + adjust;
                    return(_counter.reconnecting);
                }
                if (state == Microsoft.AspNet.SignalR.Client.ConnectionState.Disconnected)
                {
                    _counter.disconnected = _counter.disconnected + adjust;
                    return(_counter.disconnected);
                }
            }

            return(0);
        }
示例#2
0
        private Label swichLabeL(Microsoft.AspNet.SignalR.Client.ConnectionState connectionState)
        {
            switch (connectionState)
            {
            case Microsoft.AspNet.SignalR.Client.ConnectionState.Connecting: return(connectingLabel);

            case Microsoft.AspNet.SignalR.Client.ConnectionState.Connected: return(connectedLabel);

            case Microsoft.AspNet.SignalR.Client.ConnectionState.Disconnected: return(disconnectedLabel);

            case Microsoft.AspNet.SignalR.Client.ConnectionState.Reconnecting: return(ReconnectingLabel);
            }
            return(null);
        }