public static void SetHistory(int index, string line) { if (line == null) line = String.Empty; if (index >= 0 && index < history.Count) history[history.Count - index - 1] = line; }