2 using System.Collections.Generic;
5 using System.Xml.Serialization;
9 [XmlRoot(ElementName=
"TableNameMappings")]
18 if (M.
TableName.Equals(TableName, StringComparison.InvariantCultureIgnoreCase))
31 if (Score > BestScore)
52 if (!
string.IsNullOrEmpty(Filename))
54 if (
new FileInfo(Filename).Exists)
59 StreamReader streamReader =
new StreamReader(Filename);
60 Data = streamReader.ReadToEnd();
62 streamReader.Dispose();
68 throw new Exception(
"Could not read data from TableMapping file: " + Filename, E);
70 byte[] xmlBytes = Encoding.Default.GetBytes(Data);
71 using (MemoryStream ms =
new MemoryStream(xmlBytes))
80 Exception Ex =
new Exception(
"Could not deserialize the TableNameMappings config from XML data: " + E.Message, E);
81 Ex.Data.Add(
"XML Data", Data);
89 throw new FileNotFoundException(
"File does not exist: " + Filename, Filename);
102 using (MemoryStream ms =
new MemoryStream())
106 using (StreamReader sr =
new StreamReader(ms, Encoding.Default))
108 Xml = sr.ReadToEnd();
113 FileInfo FI =
new FileInfo(Filename);
114 StreamWriter SW= FI.CreateText();
static TableNameMappings LoadTableMappings(string Filename)
Simple class containing the mappinging between tablename and romname
Mapping GetBestMatchingMapping(string TableName)
void SaveTableMappings(string Filename)
string TableName
Gets or sets the name of the table. This is not necessarly the same as the name of the table file...