public bool UploadMusic(string path)
 {
     YoYoStudio.SocketService.Music.TcpAsynchronousClient tcpClient = new YoYoStudio.SocketService.Music.TcpAsynchronousClient(path);
     bool result = tcpClient.UploadFile();
     if (result)
     {
         MusicDataBinding bind = new MusicDataBinding { Name = System.IO.Path.GetFileName(path), IsSelected = false };
         Musics.Add(bind);
     }
     return result;
 }
Ejemplo n.º 2
0
        public bool UploadMusic(string path)
        {
            YoYoStudio.SocketService.Music.TcpAsynchronousClient tcpClient = new YoYoStudio.SocketService.Music.TcpAsynchronousClient(path);
            bool result = tcpClient.UploadFile();

            if (result)
            {
                MusicDataBinding bind = new MusicDataBinding {
                    Name = System.IO.Path.GetFileName(path), IsSelected = false
                };
                Musics.Add(bind);
            }
            return(result);
        }
Ejemplo n.º 3
0
        public void DeleteMusic()
        {
            YoYoStudio.SocketService.Music.TcpAsynchronousClient tcpClient = new YoYoStudio.SocketService.Music.TcpAsynchronousClient();
            List <string>           toDelete = new List <string>();
            List <MusicDataBinding> toRemove = new List <MusicDataBinding>();

            foreach (var r in Musics)
            {
                if (r.IsSelected == true)
                {
                    toDelete.Add(r.Name);
                    toRemove.Add(r);
                }
            }
            tcpClient.DeleteFile(toDelete);
            toRemove.ForEach(
                r => {
                Musics.Remove(r);
            }
                );
        }
Ejemplo n.º 4
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     TcpAsynchronousClient tcpClient = new TcpAsynchronousClient(SelectedFile);
     tcpClient.UploadFile();
 }
 public void DeleteMusic()
 {
     YoYoStudio.SocketService.Music.TcpAsynchronousClient tcpClient = new YoYoStudio.SocketService.Music.TcpAsynchronousClient();
     List<string> toDelete = new List<string>();
     List<MusicDataBinding> toRemove = new List<MusicDataBinding>();
     foreach (var r in Musics)
     {
         if (r.IsSelected == true)
         {
             toDelete.Add(r.Name);
             toRemove.Add(r);
         }
     }
     tcpClient.DeleteFile(toDelete);
     toRemove.ForEach(
         r => {
             Musics.Remove(r);
         }
         );
 }
 private List<string> LoadMusics()
 {
     TcpAsynchronousClient client = new TcpAsynchronousClient();
     return client.GetMusics();
 }