private void loadPcmData(ListViewItem fi, string fn) { byte[] data = null; try { data = File.ReadAllBytes(fn); } catch (Exception ex) { if (ex.GetType() == typeof(Exception)) { throw; } else if (ex.GetType() == typeof(SystemException)) { throw; } MessageBox.Show(ex.ToString()); } if (data != null) { PcmTimbreBase pcm = (PcmTimbreBase)fi.Tag; pcm.PcmData = data; pcm.TimbreName = Path.GetFileNameWithoutExtension(fn); fi.SubItems[1].Text = pcm.TimbreName; } propertyGrid1.Refresh(); }
private void buttonDelete_Click(object sender, EventArgs e) { for (int i = 0; i < listViewPcmSounds.SelectedItems.Count; i++) { PcmTimbreBase snd = (PcmTimbreBase)listViewPcmSounds.SelectedItems[i].Tag; snd.PcmData = null; snd.TimbreName = null; listViewPcmSounds.SelectedItems[i].SubItems[1].Text = null; } propertyGrid1.Refresh(); }