Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        CsvLoader   loader   = new CsvLoader();
        CsvTable    csvTable = loader.LoadCSV("Config/test");
        TestDataMap tMap     = new TestDataMap();
        IDataMap    tempMap  = tMap as IDataMap;

        loader.LoadCSV("Config/test", ref tempMap);
        //tMap.Load(ref csvTable);

        Dictionary <int, TestData> Dic = tMap.GetMap() as Dictionary <int, TestData>;

        //tMap.GetMap(ref Dic);
        //tMap.clearMap();
        foreach (var t in Dic)
        {
            Debug.Log("!!!!!!!" + t.Key + "=" + t.Value.Name);
        }

        //CsvTable csvTable = loader.LoadCSV("Config/" + str);
        foreach (CsvRecord record in csvTable.Records)
        {
            foreach (string header in csvTable.Headers)
            {
                Debug.Log(header + ":" + record.GetField(header));
                text.text = text.text + (header + ":" + record.GetField(header));
            }
        }
    }
Ejemplo n.º 2
0
        private static Task <List <Word> > loadLexiconAsync()
        {
            List <Word> result;

            try
            {
                result = CsvLoader.LoadCSV();
            }
            catch (Exception)
            {
                throw;
            }
            return(Task.FromResult(result));
        }