/// <summary> /// Commits all accumulated lines. /// </summary> public void CommitLines() { List <string> SortedUsingList = new List <string>(UsingList); SortedUsingList.Sort(); int i = 0; while (i < SortedUsingList.Count) { if (i + 1 < SortedUsingList.Count && SortedUsingList[i] == SortedUsingList[i + 1]) { SortedUsingList.RemoveAt(i + 1); } else { i++; } } foreach (string UsingDirective in SortedUsingList) { WriteLine($" using {UsingDirective};"); } if (SortedUsingList.Count > 0) { WriteLine(string.Empty); } foreach (string Line in LineList) { WriteLine(Line); } if (UsingList.Count > 0 || LineList.Count > 0) { UsingList.Clear(); LineList.Clear(); Flush(); } }
private static int FFI_ClearUsingList(ILuaState lua) { UsingList.Clear(); return(0); }