// public List<NameMapping> GetMappedFieldsForTable(string table) { // List<NameMapping> fields = new List<NameMapping>(); // if (mappedTables.ContainsKey(table)) { // Dictionary<string, string> mappings = mappedTables[table].Mappings; // foreach(string key in mappings.Keys) { // fields.Add(new NameMapping(key, mappings[key])); // } // } // return fields; // } public bool IsConstantPackField(string tableName, string field) { bool result = false; if (mappedTables.ContainsKey(tableName)) { MappedTable table = mappedTables[tableName]; result = table.ConstantPackValues.ContainsKey(field); } return(result); }
List <NameMapping> ConstantXmlValues(string tableName) { List <NameMapping> result = new List <NameMapping>(); if (mappedTables.ContainsKey(tableName)) { MappedTable table = mappedTables[tableName]; foreach (string key in table.ConstantXmlValues.Keys) { result.Add(new NameMapping(key, table.ConstantXmlValues[key])); } } return(result); }
// write the given mapped table to given file public void SaveToFile(StreamWriter file, MappedTable table) { string guid = table.Guid; file.WriteLine(" <table {0}=\"{1}\" {2}=\"{3}\">", NAME_ATTRIBUTE, table.TableName, GUID_ATTRIBUTE, guid); WriteMappedFields(file, PACK_ATTRIBUTE, XML_ATTRIBUTE, table.Mappings); WriteMappedFields(file, PACK_ATTRIBUTE, CONSTANT_ATTRIBUTE, table.ConstantPackValues); WriteMappedFields(file, XML_ATTRIBUTE, CONSTANT_ATTRIBUTE, table.ConstantXmlValues); WriteList(file, UNMAPPED_PACK_FIELDS, table.UnmappedPackFieldNames); WriteList(file, UNMAPPED_XML_FIELDS, table.UnmappedXmlFieldNames); file.WriteLine(" </table>"); }