Пример #1
0
 // normalizing the else control to make sure that there is 
 //space before and after else between the close and open braces
 public void elsecontrol(List<string> lis){
   List<string> li = new List<string>();
   int i = 0;
   foreach (string line in lis){
     i++;
     if (line.Contains("else") && !line.Contains("if")){
       string h = li[i - 2].Replace("}", "} " + line);
       li[i - 2].Remove(0);
       li[i - 2] = h;
       i--;
     } else {
       li.Add(line);
     }
   }
   Layers lay = new Layers();
   lay.elseifcontrol(li);
 }