Esempio n. 1
0
        public static List<string> GetSources(FileInfo file)
        {
            var sourceList = new List<string>();
            if (file.Extension.ToLower() != ".idpdb")
                sourceList.Add(Parser.ParseSource(file.FullName));//Path.GetFileNameWithoutExtension(file.FullName));
            else
            {
                using (var conn = new System.Data.SQLite.SQLiteConnection(String.Format("Data Source={0};Version=3", file.FullName)))
                {
                    conn.Open();
                    var sourceNameQuery = conn.ExecuteQuery("SELECT Name FROM SpectrumSource");
                    sourceList.AddRange(sourceNameQuery.Select(o => o.GetString(0)));
                }
            }

            return sourceList;
        }