public GraphBuildDayInfo(GraphBuildInfo buildInfo, Translations translations) { this.translations = translations; myBuildDate = buildInfo.BuildDate(); myBuilds = new List <GraphBuildInfo>(); //myBuilds.Add(buildInfo); AddBuild(buildInfo); }
///<summary> /// Returns a sorted list containing build information per buildday ///</summary> public List <GraphBuildDayInfo> GetBuildHistory(Int32 maxAmountOfDays) { GraphBuildInfo currentBuildInfo; GraphBuildDayInfo currentBuildDayInfo; // adding the builds to a list per day var foundDates = new Dictionary <DateTime, GraphBuildDayInfo>(); var dateSorter = new List <DateTime>(); foreach (IBuildSpecifier buildSpecifier in mybuildSpecifiers) { currentBuildInfo = new GraphBuildInfo(buildSpecifier, mylinkFactory); if (!foundDates.ContainsKey(currentBuildInfo.BuildDate())) { foundDates.Add(currentBuildInfo.BuildDate(), new GraphBuildDayInfo(currentBuildInfo, this.translations)); dateSorter.Add(currentBuildInfo.BuildDate()); } else { currentBuildDayInfo = foundDates[currentBuildInfo.BuildDate()]; currentBuildDayInfo.AddBuild(currentBuildInfo); foundDates[currentBuildInfo.BuildDate()] = currentBuildDayInfo; } } //making a sorted list of the dates where we have builds of //and limit to the amount specified in maxAmountOfDays dateSorter.Sort(); while (dateSorter.Count > maxAmountOfDays) { dateSorter.RemoveAt(0); } //making final sorted arraylist var result = new List <GraphBuildDayInfo>(); myHighestAmountPerDay = 1; foreach (DateTime BuildDate in dateSorter) { currentBuildDayInfo = foundDates[BuildDate]; result.Add(currentBuildDayInfo); if (currentBuildDayInfo.AmountOfBuilds > myHighestAmountPerDay) { myHighestAmountPerDay = currentBuildDayInfo.AmountOfBuilds; } myOKBuildAmount += currentBuildDayInfo.AmountOfOKBuilds; myFailedBuildAmount += currentBuildDayInfo.AmountOfFailedBuilds; } return(result); }
// adds a build to this day public void AddBuild(GraphBuildInfo buildInfo) { myBuilds.Insert(0, buildInfo); if (buildInfo.IsSuccesFull()) { myOKBuildAmount++; } else { myFailedBuildAmount++; } }
public GraphBuildDayInfo(GraphBuildInfo buildInfo, Translations translations) { this.translations = translations; myBuildDate = buildInfo.BuildDate(); myBuilds = new List<GraphBuildInfo>(); //myBuilds.Add(buildInfo); AddBuild(buildInfo); }
///<summary> /// Returns a sorted list containing build information per buildday ///</summary> public List<GraphBuildDayInfo> GetBuildHistory(Int32 maxAmountOfDays) { GraphBuildInfo currentBuildInfo; GraphBuildDayInfo currentBuildDayInfo; // adding the builds to a list per day var foundDates = new Dictionary<DateTime, GraphBuildDayInfo>(); var dateSorter = new List<DateTime>(); foreach (IBuildSpecifier buildSpecifier in mybuildSpecifiers) { currentBuildInfo = new GraphBuildInfo(buildSpecifier, mylinkFactory); if (!foundDates.ContainsKey(currentBuildInfo.BuildDate())) { foundDates.Add(currentBuildInfo.BuildDate(), new GraphBuildDayInfo(currentBuildInfo, this.translations) ); dateSorter.Add(currentBuildInfo.BuildDate()); } else { currentBuildDayInfo = foundDates[currentBuildInfo.BuildDate()]; currentBuildDayInfo.AddBuild(currentBuildInfo); foundDates[currentBuildInfo.BuildDate()] = currentBuildDayInfo; } } //making a sorted list of the dates where we have builds of //and limit to the amount specified in maxAmountOfDays dateSorter.Sort(); while (dateSorter.Count > maxAmountOfDays) { dateSorter.RemoveAt(0); } //making final sorted arraylist var result = new List<GraphBuildDayInfo>(); myHighestAmountPerDay = 1; foreach (DateTime BuildDate in dateSorter) { currentBuildDayInfo = foundDates[BuildDate]; result.Add(currentBuildDayInfo); if (currentBuildDayInfo.AmountOfBuilds > myHighestAmountPerDay) { myHighestAmountPerDay = currentBuildDayInfo.AmountOfBuilds; } myOKBuildAmount += currentBuildDayInfo.AmountOfOKBuilds; myFailedBuildAmount += currentBuildDayInfo.AmountOfFailedBuilds; } return result; }
///<summary> /// Returns a sorted list containing build information per buildday ///</summary> public ArrayList GetBuildHistory(Int32 maxAmountOfDays) { ArrayList Result; ArrayList DateSorter; Hashtable FoundDates; GraphBuildInfo CurrentBuildInfo; GraphBuildDayInfo CurrentBuildDayInfo; // adding the builds to a list per day FoundDates = new Hashtable(); DateSorter = new ArrayList(); foreach (IBuildSpecifier buildSpecifier in mybuildSpecifiers) { CurrentBuildInfo = new GraphBuildInfo(buildSpecifier, mylinkFactory); if (!FoundDates.Contains(CurrentBuildInfo.BuildDate())) { FoundDates.Add(CurrentBuildInfo.BuildDate(), new GraphBuildDayInfo(CurrentBuildInfo, this.translations) ); DateSorter.Add(CurrentBuildInfo.BuildDate()); } else { CurrentBuildDayInfo = FoundDates[CurrentBuildInfo.BuildDate()] as GraphBuildDayInfo; CurrentBuildDayInfo.AddBuild(CurrentBuildInfo); FoundDates[CurrentBuildInfo.BuildDate()] = CurrentBuildDayInfo; } } //making a sorted list of the dates where we have builds of //and limit to the amount specified in maxAmountOfDays DateSorter.Sort(); while (DateSorter.Count > maxAmountOfDays) { DateSorter.RemoveAt(0); } //making final sorted arraylist Result = new ArrayList(); myHighestAmountPerDay = 1; foreach (DateTime BuildDate in DateSorter) { CurrentBuildDayInfo = FoundDates[BuildDate] as GraphBuildDayInfo; Result.Add(CurrentBuildDayInfo); if (CurrentBuildDayInfo.AmountOfBuilds > myHighestAmountPerDay) { myHighestAmountPerDay = CurrentBuildDayInfo.AmountOfBuilds; } myOKBuildAmount += CurrentBuildDayInfo.AmountOfOKBuilds; myFailedBuildAmount += CurrentBuildDayInfo.AmountOfFailedBuilds; } return Result; }