private void OnConnectionSuccess(IConnectedSphero sphero)
        {
            lock (this)
            {
                _connectedSpheros.Add(sphero);
            }

            // if we've got at least one connection...
            IsConnected = true;
        }
        private void OnConnectionSuccess(IConnectedSphero sphero)
        {
            lock (this)
            {
                _connectedSpheros.Add(sphero);
            }

            // if we've got at least one connection...
            IsConnected = true;
        }
        private void SendCommand(IConnectedSphero sphero, ISpheroCommand command)
        {
            if (sphero == null)
            {
                // TODO - trace this ignore
                SpheroTrace.Trace("Ignoring command {0}", command);
                return;
            }

            //SpheroTrace.Trace("Sending command {0}", command);
            sphero.SendAndReceive(command, OnCommandSuccess, OnCommandError);
        }
Example #4
0
        private void OnConnectionSuccess(IConnectedSphero sphero)
        {
            lock (this)
            {
                if (_shutdownCalled)
                {
                    sphero.Disconnect();
                    return;
                }

                IsConnecting    = false;
                ConnectedSphero = sphero;
                ConnectedSphero.Disconnected += ConnectedSpheroOnDisconnected;
                foreach (var c in _childViewModels)
                {
                    c.OnSpheroConnected();
                }
            }
        }
Example #5
0
 public ConnectedSphero(IConnectedSphero sphero)
 {
     _sphero = sphero;
 }
        private void SendCommand(IConnectedSphero sphero, ISpheroCommand command)
        {
            if (sphero == null)
            {
                // TODO - trace this ignore
                SpheroTrace.Trace("Ignoring command {0}", command);
                return;
            }

            //SpheroTrace.Trace("Sending command {0}", command);
            sphero.SendAndReceive(command, OnCommandSuccess, OnCommandError);
        }
Example #7
0
        private void OnConnectionSuccess(IConnectedSphero sphero)
        {
            lock (this)
            {
                if (_shutdownCalled)
                {
                    sphero.Disconnect();
                    return;
                }

                IsConnecting = false;
                ConnectedSphero = sphero;
                ConnectedSphero.Disconnected += ConnectedSpheroOnDisconnected;
                foreach (var c in _childViewModels)
                {
                    c.OnSpheroConnected();
                }
            }
        }