/// <summary> /// 添加行数据 /// </summary> private void AddLine(string line) { if (string.IsNullOrEmpty(line)) { return; } var items = line.Split('\t'); var len = items.Length; if (len < (int)eLanguageEnum.Th) { len = (int)eLanguageEnum.Th; } ConfigLineData configLineData = new ConfigLineData { Key = items[0] }; configLineData.Values = new string[len]; for (int i = 0; i < configLineData.Values.Length; i++) { configLineData.Values[i] = ""; } for (int i = 1; i < items.Length; i++) { configLineData.Values[i - 1] = items[i]; } configLineDatas.Add(configLineData); }
/// <summary> /// 添加表信息 /// </summary> /// <param name="desc"></param> public void AddEmptyLine(string desc) { ConfigLineData configLineData = new ConfigLineData { Key = desc, Values = new string[0] }; configLineDatas.Add(configLineData); }
/// <summary> /// 添加一行数据 /// </summary> /// <param name="key"></param> public void AddNewKey(string key) { ConfigLineData configLineData = new ConfigLineData { Key = key, Values = new string[7] }; configLineData.Values[0] = key; configLineDatas.Add(configLineData); }