Example #1
0
 public bool LoadFromCsvFile(string fileName)
 {
     dataMap.Clear();
     try{
         ByteReader reader = ByteReader.Open(fileName);
         int        line   = 0;
         for (; ;)
         {
             BetterList <string> temp = reader.ReadCSV();
             if (temp == null || temp.size == 0)
             {
                 break;
             }
             if (line > 2)
             {
                 bushou newData = new bushou();
                 newData.ReadFrom(temp);
                 dataMap.Add(newData.index, newData);
             }
             line++;
         }
     }catch (Exception e) {
         return(false);
     }
     return(dataMap.Count > 0);
 }
Example #2
0
        public bushou FindData(int key)
        {
            bushou ret = null;

            if (dataMap.ContainsKey(key))
            {
                ret = dataMap[key];
            }
            return(ret);
        }
Example #3
0
 public bool LoadFromFile(string fileName)
 {
     dataMap.Clear();
     try{
         using (var stream = new FileStream(fileName, FileMode.Open))
         {
             Zby.ByteBuffer readBuff = new Zby.ByteBuffer(stream);
             do
             {
                 bushou newData = new bushou();
                 try{
                     newData.ReadFrom(readBuff);
                     dataMap.Add(newData.index, newData);
                 }catch (Exception e) {
                     break;
                 }
             }while(true);
         }
     }catch (Exception e) {
         return(false);
     }
     return(dataMap.Count > 0);
 }