public int CompareTo(object obj) { if (obj == null) { throw new ArgumentNullException("obj"); } StackHashEventInfoCollection events = obj as StackHashEventInfoCollection; if (events.Count != this.Count) { return(-1); } foreach (StackHashEventInfo thisEventInfo in this) { StackHashEventInfo matchingEventInfo = events.FindEventInfo(thisEventInfo); if (matchingEventInfo == null) { return(-1); } } // Must be a match. return(0); }
} // Needed to serialize; public StackHashEventPackage(StackHashEventInfoCollection eventInfoList, StackHashCabPackageCollection cabs, StackHashEvent eventData, int productId) { m_EventInfoList = eventInfoList; m_Cabs = cabs; m_EventData = eventData; m_ProductId = productId; m_CriteriaMatchMap = 0; }
public object Clone() { StackHashEventInfoCollection eventInfoCollection = new StackHashEventInfoCollection(); foreach (StackHashEventInfo eventInfo in this) { eventInfoCollection.Add((StackHashEventInfo)eventInfo.Clone()); } return(eventInfoCollection); }
/// <summary> /// Updates the statistics based on the specified event info collection. /// Each Event info will cause an update to each of the stats lists. /// </summary> /// <param name="stackHashEventInfoCollection">Collection of new event infos.</param> public void AddNewEventInfos(StackHashEventInfoCollection stackHashEventInfoCollection) { if (stackHashEventInfoCollection == null) { throw new ArgumentNullException("stackHashEventInfoCollection"); } foreach (StackHashEventInfo eventInfo in stackHashEventInfoCollection) { AddNewEventInfo(eventInfo); } }
public StackHashEventInfoCollection Normalize() { StackHashEventInfoCollection newEventInfos = new StackHashEventInfoCollection(); foreach (StackHashEventInfo eventInfo in this) { StackHashEventInfo newEventInfo = eventInfo.Normalize(); StackHashEventInfo foundEventInfo = newEventInfos.FindEventInfo(newEventInfo); if (foundEventInfo == null) { newEventInfos.Add(newEventInfo); } else { foundEventInfo.TotalHits += newEventInfo.TotalHits; } } return(newEventInfos); }