Exemple #1
0
 private void AddAppLayoutSectionsFor(string layoutName, ProcessWindow[] processWindows)
 {
     processWindows.ForEach(
         w =>
     {
         var proc = w?.Process?.MainModule.FileName;
         if (proc == null)
         {
             return;
         }
         var procFileName = Path.GetFileName(proc);
         var sectionName  = MakeAppLayoutSectionNameFor(
             layoutName,
             procFileName
             );
         _config.AddSection(sectionName);
         var pos = w.Position;
         if (string.IsNullOrWhiteSpace(proc) || pos == null)
         {
             return;
         }
         var section              = _config[sectionName];
         section[Keys.POSITION]   = pos.ToString();
         section[Keys.TITLE]      = w.WindowTitle;
         section[Keys.EXECUTABLE] = proc;
     });
 }
Exemple #2
0
 public void Add(KeyValuePair <string, string> item)
 {
     if (Section == null)
     {
         _iniFile.AddSection(_section);
     }
     // ReSharper disable once PossibleNullReferenceException
     Section.Add(item);
 }
 private void CreateEmptySection(
     IINIFile iniFile,
     string sectionName)
 {
     iniFile.AddSection(sectionName);
 }