public static String entry(String[] time) { int seconds = 0; if (time.Any()) { foreach (string text in time) { String[] tempLine = text.Split(' '); seconds = seconds + FormatLine.makeItSecond(Convert.ToInt32(tempLine[3].Split(':')[0]), Convert.ToInt32(tempLine[3].Split(':')[1]), Convert.ToInt32(tempLine[3].Split(':')[2])); } } return(FormatLine.makeItHour(seconds)); }
private void frmMain_Load(object sender, EventArgs e) { List <String> timeList = new List <string>(); FileLoaded filetoload = new FileLoaded(); FormatLine formatLine = new FormatLine(); timeList = FileLoaded.Initial(); if (timeList.Any()) { foreach (var time in timeList) { lstTime.Items.Add(FormatLine.FormatString(time.ToString())); } } else { Environment.Exit(1); } }