-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextFileImporter.cs
More file actions
47 lines (38 loc) · 1.11 KB
/
TextFileImporter.cs
File metadata and controls
47 lines (38 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#region
using System;
using System.IO;
using Tabster.Core.Types;
using Tabster.Data;
using Tabster.Data.Processing;
#endregion
namespace TextFile
{
public class TextFileImporter : ITablatureFileImporter
{
public TextFileImporter()
{
FileType = new FileType("Text File", ".txt");
}
#region Implementation of ITablatureDocumentImporter
public FileType FileType { get; private set; }
public Version Version
{
get { return new Version("1.0"); }
}
public AttributedTablature Import(string fileName)
{
var contents = File.ReadAllText(fileName);
var tab = new AttributedTablature {Contents = contents};
return tab;
}
public AttributedTablature Import(string fileName, string artist, string title, TablatureType type)
{
var tab = Import(fileName);
tab.Artist = artist;
tab.Title = title;
tab.Type = type;
return tab;
}
#endregion
}
}