protected virtual void CmdGetWellItems() { this.items.Clear(); string str = string.Empty; for (int i = 0; i < Lines.Count; i++) { str = Lines[i]; // 读到结束符不继续读取 if (str.StartsWith("/") && str.EndsWith("/")) { break; } // 不为空的行 if (str.IsWorkLine()) { List <string> newStr = str.EclExceptSpaceToArray(); if (newStr.Count > 0) { int index = 1; newStr.ForEach(l => items.Add(StringModel.Build(l, (index++).ToString()))); } } } }
public static StringModel Build(string stringTemp, string index = null) { StringModel m = new StringModel(); m.Value = stringTemp; m.index = index; return(m); }
/// <summary> 重建项 </summary> public void BuildItem(int count, string defaultValue = null) { items.Clear(); for (int i = 0; i < count; i++) { StringModel sm = new StringModel(); sm.Index = (i + 1).ToString(); sm.Value = defaultValue; this.items.Add(sm); } }