public override void LoadSection(string section, INIFile file) { foreach (PropertyDescriptor item in TypeDescriptor.GetProperties(this)) { if (item.IsBrowsable) { if (item.Name == "WaitForEXEN") { for (int index = 1; index < MaxWaitExeCount; index++) { var key = string.Format("WaitForEXE{0}", index); var iniData = file.ReadValue(section, key, null); if (string.IsNullOrWhiteSpace(iniData)) { break; } WaitForEXEN.Add(new WaitForEXENValue(index, iniData)); } } else { ReadValue(section, file, item); } } } }
public void UpdateWaitForExeList(List <string> exeFileNames, bool forceUpdate = false, TreeNode topNode = null) { if (WaitForEXEN.Count == 0 || forceUpdate) { int startCount = WaitForEXEN.Count + 1; List <string> existingNames = WaitForEXEN.ConvertAll((item) => item.ExeName); foreach (var item in exeFileNames) { if (string.IsNullOrWhiteSpace(item)) { continue; } if (!existingNames.Exists((file) => string.Compare(file, item, true) == 0)) { var tempVal = new WaitForEXENValue(startCount, item); WaitForEXEN.Add(tempVal); startCount++; } } if (topNode != null) { topNode.Nodes.Clear(); foreach (var listItem in WaitForEXEN) { topNode.Nodes.Add(listItem.ToString()); } } } }
public void UpdateWaitForExeN(List <string> exeFileNames) { int startCount = WaitForEXEN.Count + 1; List <string> existingNames = WaitForEXEN.ConvertAll((item) => item.ExeName); foreach (var item in exeFileNames) { if (string.IsNullOrWhiteSpace(item)) { continue; } if (!existingNames.Exists((file) => string.Compare(file, item, true) == 0)) { var tempVal = new WaitForEXENValue(startCount, item); WaitForEXEN.Add(tempVal); startCount++; } } }