public BtnConfigViewModel() { _mandos = XMLMandos.getMandos(@"Configuracion\Mandos"); SelectedMando = _mandos.ElementAt(0); _groupName = "Default"; //COMMANDS AddGroup = new RelayCommand(AddGroup_E, AddGroup_CE); AsignarTecla = new RelayCommand(AsignarTecla_E, AsignarTecla_CE); DeleteGroup = new RelayCommand(DeleteGroup_E, DeleteGroup_CE); }
private void serverListener() { try { networkStream = cliente.GetStream(); String data; while (networkStream.ReadByte() > 0) { byte[] bytes = new Byte[cliente.Available]; networkStream.Read(bytes, 0, bytes.Length); if (bytes.Length > 0) { data = Encoding.UTF8.GetString(bytes); //LogFile.Log("Serverrecive", data); if (data.Substring(0, 1) == ":") { string[] datos = data.Split(':'); this.Nombre = datos[1]; this.TipoDispositivo = (datos[2] == "false") ? "Móvil" : "Tablet"; this.Mando = datos[3]; this.GrupoMando = datos[4]; sendClient("Groups", string.Join(",", XMLMandos.getGroups(datos[3]))); } else { switch (Mando) { case "Juego": gamePad(data); break; case "Multimedia": multimedia(data); break; case "Presentaciones": presentation(data); break; case "Mouse": mouse(data); break; } } } } //Comunicar desconexion del cliente al pool. Close(); } catch (SocketException se) { Close(); } catch (Exception e) { Close(); } }