Pastebin: OmegaChart ダウンロードindex.txtとローカルindex.txtをマージする機能 brand.cs

Format
Plain text
Post date
2017-12-11 23:56
Zeitraum der Veröffentlichung
Unbegrenzt
  1. //brand.cs にあるpublic void Load(string filename)の近くに下記内容をコピー&ペースト
  2. //注意:差し替えではなく追加。
  3. public void Load(System.Collections.Generic.Dictionary<int, string> dic)
  4. {
  5. int n = 1;
  6. ArrayList splits = new ArrayList();
  7. _stockBrandCount = 0;
  8. _data.Clear();
  9. _farms.Clear();
  10. LoadBuiltIns();
  11. foreach (var e in dic)
  12. {
  13. var d = e.Value.Split(',');
  14. if (d.Length < 4) throw new IOException("index file format error: line" + n);
  15. try
  16. {
  17. int code = Int32.Parse(d[0]);
  18. BasicBrand br = new BasicBrand(d[1], code, (MarketType)Enum.Parse(typeof(MarketType), d[2], true));
  19. br.Unit = Int32.Parse(d[3]);
  20. _data[code] = br;
  21. _stockBrandCount++;
  22. for (int i = 4; i < d.Length; i++)
  23. {
  24. string col = d[i];
  25. if (col == "N225") br.Nikkei225 = true;
  26. if (col == "A500") br.Active500 = true;
  27. if (col == "OBS") br.Obsolete = true;
  28. Debug.Assert(col.Length > 0);
  29. if (col.Length > 0 && col[0] == 'S') splits.Add(new SplitInfo(d[i]));
  30. }
  31. if (splits.Count > 0)
  32. {
  33. br.SplitInfo = (SplitInfo[])splits.ToArray(typeof(SplitInfo));
  34. splits.Clear();
  35. }
  36. }
  37. catch (Exception ex)
  38. {
  39. Debug.WriteLine(String.Format("{0} 行{1} {2}", ex.Message, n, e.Value));
  40. }
  41. //n++;
  42. //Debug.WriteLine(n);
  43. }
  44. }
Download Printable view

URL of this paste

Embed with JavaScript

Embed with iframe

Raw text