Exemplo n.º 1
0
        //Disconnect
        #region
        private void verbreekVerbindingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                currentPlaylistRead?.Abort();
            }
            catch
            {
            }
            dynamic request = new
            {
                Action = "disconnect"
            };

            _session?.Send(JsonConvert.SerializeObject(request));
            _client?.Close();
            _readThread?.Abort();
            _session          = null;
            ServerStatus.Text = "Disconnected";
        }
Exemplo n.º 2
0
 //Play
 #region
 private void playToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (_session != null)
     {
         dynamic request = new
         {
             Action = "song/play"
         };
         _session.Send(JsonConvert.SerializeObject(request));
     }
     else
     {
         MessageBox.Show("Not connected to server");
     }
 }