public static void AddTimeRecorder(TimeType t, TimeRecorder timeRecorder) { List <TimeRecorder> timeRecs = null; if (!timeRecorders.ContainsKey(t)) { timeRecs = new List <TimeRecorder>(); timeRecorders.Add(t, timeRecs); } else { timeRecs = timeRecorders[t]; } timeRecs.Add(timeRecorder); }