Ejemplo n.º 1
0
        private void Window_Drop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                foreach (string item in files)
                {
                    if (!item.isFormats(StaticFormatsSound.FormatsSound))
                    {
                        continue;
                    }
                    SoundEngine se = new SoundEngine();
                    se.Sound(item);

                    DPanelSound dPanelSound = new DPanelSound()
                    {
                        NameSound = se.Name,
                        Path      = item,
                        TotalTime = se.TotalTime(),
                        INDEX     = StakPanelListSound.Children.Count
                    };

                    dPanelSound.EventMouseButtonHandler += (oo, ee) =>
                    {
                        SetCurSound(dPanelSound);
                    };
                    dPanelSound.REventMouseButtonHandler += (oo, ee) =>
                    {
                        StakPanelListSound.Children.RemoveAt(dPanelSound.INDEX);
                        cur_list_sound.RemoveID(dPanelSound.INDEX);
                    };
                    dPanelSound.Update();
                    StakPanelListSound.Children.Add(dPanelSound);
                    cur_list_sound.AddStr(item);
                }
                SystemIO.Write(SOUND_LIST_ALL.path, SOUND_LIST_ALL_serializer.Serialize(cur_list_sound));
            }
        }