Exemple #1
0
        private void button_Click_4(object sender, RoutedEventArgs e)
        {
            string LoadSp = OpenSpectacle.Open(this, Config.GetConfigValue("MusicDir"));

            if (LoadSp == null)
            {
                return;
            }
            Config.SetConfigValue("file", LoadSp);
            if (File.Exists(System.IO.Path.Combine(Config.GetConfigValue("MusicDir"), LoadSp)))
            {
                LoadMusic(LoadSp);
            }
        }
Exemple #2
0
        public static string Open(Window ParentWindow, string FilesDir)
        {
            OpenSpectacle OS = new OpenSpectacle(ParentWindow);

            if (!(Directory.Exists(FilesDir)))
            {
                Directory.CreateDirectory(FilesDir);
            }
            OS.Files = Directory.EnumerateFiles(FilesDir, "*.sdb").ToList <string>();
            foreach (string FileToAdd in OS.Files)
            {
                SQLite.MusicDB MDB      = new SQLite.MusicDB(FileToAdd);
                string         Key      = MDB.Name;
                string         FileName = System.IO.Path.GetFileName(FileToAdd);
                Key = OS.FilesAndNames.ContainsKey(Key) ? Key + $" ({FileName})" : Key;
                OS.FileList.Items.Add(Key);
                OS.FilesAndNames.Add(Key, FileName);
            }

            OS.ShowDialog();
            return(OS.Result);
        }