Пример #1
0
 private void DeleteAudioItem(UCUploadAudioItem uuai)
 {
     m_pl_uploadaudios.Controls.Remove(uuai);
     m_lst_uuai.Remove(uuai);
     for (int i = 0; i < m_lst_uuai.Count; i++)
     {
         m_lst_uuai[i].Location = new Point(0, 37 * i);
     }
 }
Пример #2
0
 private void setupAudio(String audiotype)
 {
     using (OpenFileDialog openFileDialog = new OpenFileDialog())
     {
         openFileDialog.Filter = "MP3文件(*.mp3)|*.mp3";
         if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             string            filename = openFileDialog.FileName;
             String            name     = System.IO.Path.GetFileName(filename);
             int               timelen  = 280; // TODO: get timelen dynamically
             UploadAudioItem   uai      = new UploadAudioItem(audiotype, name, timelen, filename);
             UCUploadAudioItem uuai     = new UCUploadAudioItem(uai);
             uuai.DeleteAudioItem = DeleteAudioItem;
             m_pl_uploadaudios.Controls.Add(uuai);
             uuai.Location = new Point(0, 37 * m_lst_uuai.Count);
             m_lst_uuai.Add(uuai);
         }
     }
 }