Beispiel #1
0
        public KSXmlRecordSet GetAllTrackNames()
        {
            var recordSet = new KSXmlRecordSet();

            foreach (var trackInformation in _data)
            {
                var record = new KSXmlRecord();
                record.SetFieldValue("id", trackInformation.Key);
                record.SetFieldValue("Name", trackInformation.Value.Name);
                recordSet.AddRecord(record);
            }

            return recordSet;
        }
Beispiel #2
0
        public KSXmlRecord GetTrackInformation(int id)
        {
            if (!_data.ContainsKey(id))
            {
                throw new Exception("Invalid id");
            }

            var trackInformation = _data[id];

            var record = new KSXmlRecord();
            record.SetFieldValue("id", id);
            record.SetFieldValue("Name", trackInformation.Name);
            record.SetFieldValue("Artist", trackInformation.Artist);
            record.SetFieldValue("Album", trackInformation.Album);
            record.SetFieldValue("Length", trackInformation.Length.ToString(CultureInfo.InvariantCulture));

            return record;
        }