Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ExcelDataList.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.IO;
3
4public class ExcelDataList
5{
6 public List<ExcelData> items = new List<ExcelData>(0);
7
8 public Dictionary<string, Dictionary<string, string>> all = new Dictionary<string, Dictionary<string, string>>();
9
10 public List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
11
12 protected bool initialized;
13
14 public virtual int StartIndex => 5;
15
16 public void Reload()
17 {
18 all.Clear();
19 list.Clear();
20 initialized = false;
21 }
22
23 public virtual void Initialize()
24 {
25 if (initialized)
26 {
27 return;
28 }
29 foreach (ExcelData item in items)
30 {
31 item.startIndex = StartIndex;
32 List<Dictionary<string, string>> obj = item.BuildList();
33 string directoryName = new FileInfo(item.path).DirectoryName;
34 foreach (Dictionary<string, string> item2 in obj)
35 {
36 item2["path"] = directoryName;
37 all[item2["id"]] = item2;
38 list.Add(item2);
39 }
40 }
42 initialized = true;
43 }
44
45 public virtual void OnInitialize()
46 {
47 }
48
49 public Dictionary<string, string> GetRow(string id)
50 {
51 if (!initialized)
52 {
53 Initialize();
54 }
55 return all.TryGetValue(id) ?? list[0];
56 }
57}
Dictionary< string, Dictionary< string, string > > all
Definition: ExcelDataList.cs:8
List< ExcelData > items
Definition: ExcelDataList.cs:6
List< Dictionary< string, string > > list
virtual int StartIndex
virtual void OnInitialize()
Dictionary< string, string > GetRow(string id)
virtual void Initialize()