Ejemplo n.º 1
0
        static private Dictionary <string, Ethnicity> Init()
        {
            Dictionary <string, Ethnicity> ethnicityNameToEthnicity = new Dictionary <string, Ethnicity>();

            using (TextReader textReader = Linkdis.OpenResource("datafileList.txt"))
            {
                foreach (var row in SpecialFunctions.ReadDelimitedFile(textReader, new { Ethnicity = "", Class = "", HlaLengthList = "", FileName = "" }, new char[] { '\t' }, true))
                {
                    Ethnicity ethnicity          = ethnicityNameToEthnicity.GetValueOrDefault(row.Ethnicity.ToLowerInvariant());
                    EClass    eclass             = ethnicity.HlaClassNameToEClass.GetValueOrDefault(row.Class);
                    var       hlaLengthListQuery =
                        from hlaLengthAsString in row.HlaLengthList.Split(' ')
                        select int.Parse(hlaLengthAsString);

                    LinkedList1 <int> hlaLengthList = LinkedList1 <int> .GetInstanceFromList(hlaLengthListQuery.ToList());


                    TableInfo tableInfo = eclass.HlaLengthListToTableInfo.GetValueOrDefault(hlaLengthList);
                    tableInfo.HlaMsr1Factory = HlaMsr1Factory.GetFactory(hlaLengthList);
                    tableInfo.LoadTable(row.FileName, row.Class);
                }
            }
            return(ethnicityNameToEthnicity);
        }
 public static IEnumerable <string> EthnicityNameMixedList()
 {
     return(Ethnicity.NameMixedList());
 }