private void button_open_folder_Click(object sender, EventArgs e) { if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { CommonInterface.GetFilesFromFolder(folderBrowserDialog1.SelectedPath, true); } }
private void button_open_folder_Click(object sender, EventArgs e) { if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { listView1.BeginUpdate(); CommonInterface.GetFilesFromFolder(folderBrowserDialog1.SelectedPath); listView1.EndUpdate(); } }
static void StartupNextInstanceHandler(object sender, StartupNextInstanceEventArgs e) { switch (e.CommandLine.Count) { case 2: foreach (Form item in Application.OpenForms) { if (item is Form1) { if (Directory.Exists(e.CommandLine[1])) { CommonInterface.GetFilesFromFolder(e.CommandLine[1]); } else if (File.Exists(e.CommandLine[1])) { CommonInterface.AddTrackOrURL(e.CommandLine[1]); } break; } } break; case 3: if (e.CommandLine[1].ToLower().Equals("radio")) { foreach (Form item in Application.OpenForms) { if (item is Form2) { if (Directory.Exists(e.CommandLine[2])) { CommonInterface.GetFilesFromFolder(e.CommandLine[2], true); } else if (File.Exists(e.CommandLine[2])) { CommonInterface.ReadPlayList(e.CommandLine[2], true); } break; } } } break; default: break; } }
public Form2(string path, bool isFile = false) { InitializeComponent(); CommonInterface.Link2 = this; colorSlider1.Value = Properties.Settings.Default.Volume; checkBox2.Checked = Properties.Settings.Default.SoundOff; CommonInterface.Volume = Properties.Settings.Default.Volume2; Audio.Volume = colorSlider1.Value; if (isFile) { CommonInterface.ReadPlayList(path, true); } else { CommonInterface.GetFilesFromFolder(path, true); } }
private void listView1_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); foreach (string filePath in files) { if (Directory.Exists(filePath)) { CommonInterface.GetFilesFromFolder(filePath, true); } else { CommonInterface.CheckExtension(new FileInfo(filePath), true); } } } }
public Form1(string path, bool isFile = false) { InitializeComponent(); CommonInterface.Link1 = this; CommonInterface.SetFileFilter(); Audio.InitAudio(Audio.HZ); comboBox1.SelectedIndex = Properties.Settings.Default.RepeatMode; checkBox1.Checked = Properties.Settings.Default.RandomMode; colorSlider2.Value = Properties.Settings.Default.Volume; checkBox2.Checked = Properties.Settings.Default.SoundOff; CommonInterface.Volume = Properties.Settings.Default.Volume2; Audio.Volume = colorSlider2.Value; if (isFile) { CommonInterface.AddTrackOrURL(path); } else { CommonInterface.GetFilesFromFolder(path); } }
public static void GetDataFromClipboard(bool isRadio = false) { if (Clipboard.ContainsFileDropList()) { StringCollection files = Clipboard.GetFileDropList(); if (isRadio) { Link2.listBox1.BeginUpdate(); } else { Link1.listView1.BeginUpdate(); } foreach (string filePath in files) { if (Directory.Exists(filePath)) { CommonInterface.GetFilesFromFolder(filePath, isRadio); } else { CommonInterface.CheckExtension(new FileInfo(filePath), isRadio); } } if (isRadio) { Link2.listBox1.EndUpdate(); } else { Link1.listView1.EndUpdate(); } } else if (isRadio && Clipboard.ContainsText()) { AddTrackOrURL(Clipboard.GetText(), isRadio); } }