Exemple #1
0
        public void UpdateKillProcList(List <string> exeFileNames, bool forceUpdate = false, TreeNode topNode = null)
        {
            if (KillProcN.Count == 0 || forceUpdate)
            {
                int           startCount    = KillProcN.Count + 1;
                List <string> existingNames = KillProcN.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 KillProcNValue(startCount, item);
                        KillProcN.Add(tempVal);
                        startCount++;
                    }
                }

                if (topNode != null)
                {
                    topNode.Nodes.Clear();
                    foreach (var listItem in KillProcN)
                    {
                        topNode.Nodes.Add(listItem.ToString());
                    }
                }
            }
        }
Exemple #2
0
 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 if (item.Name == "KillProcN")
             {
                 for (int index = 1; index < MaxWaitExeCount; index++)
                 {
                     var key     = string.Format("KillProc{0}", index);
                     var iniData = file.ReadValue(section, key, null);
                     if (string.IsNullOrWhiteSpace(iniData))
                     {
                         break;
                     }
                     KillProcN.Add(new KillProcNValue(index, iniData));
                 }
             }
             else
             {
                 ReadValue(section, file, item);
             }
         }
     }
 }