private void updateCategoryEntries(TVStation tvStation, EITEntry eitEntry) { if (categoryEntries == null) { categoryEntries = new Collection <CategoryEntry>(); } CategoryEntry newEntry = new CategoryEntry(tvStation.OriginalNetworkID, tvStation.TransportStreamID, tvStation.ServiceID, eitEntry.StartTime, eitEntry.EventName, eitEntry.ContentType, eitEntry.ContentSubType); foreach (CategoryEntry oldEntry in categoryEntries) { if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID == newEntry.TransportStreamID && oldEntry.ServiceID == newEntry.ServiceID && oldEntry.StartTime == newEntry.StartTime) { return; } if (oldEntry.NetworkID > newEntry.NetworkID) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID > newEntry.TransportStreamID) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID == newEntry.TransportStreamID && oldEntry.ServiceID > newEntry.ServiceID) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID == newEntry.TransportStreamID && oldEntry.ServiceID == newEntry.ServiceID && oldEntry.StartTime > newEntry.StartTime) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } } categoryEntries.Add(newEntry); }
private void updateCategoryEntries(int networkID, int transportStreamID, int serviceID, DateTime startTime, string eventName, int category) { if (categoryEntries == null) categoryEntries = new Collection<CategoryEntry>(); CategoryEntry newEntry = new CategoryEntry(networkID, transportStreamID, serviceID, startTime, eventName, category); foreach (CategoryEntry oldEntry in categoryEntries) { if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID == newEntry.TransportStreamID && oldEntry.ServiceID == newEntry.ServiceID && oldEntry.StartTime == newEntry.StartTime) return; if (oldEntry.NetworkID > newEntry.NetworkID) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID > newEntry.TransportStreamID) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID == newEntry.TransportStreamID && oldEntry.ServiceID > newEntry.ServiceID) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID == newEntry.TransportStreamID && oldEntry.ServiceID == newEntry.ServiceID && oldEntry.StartTime > newEntry.StartTime) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } } categoryEntries.Add(newEntry); }
private void updateCategoryEntries(TVStation tvStation, EITEntry eitEntry) { if (categoryEntries == null) categoryEntries = new Collection<CategoryEntry>(); CategoryEntry newEntry = new CategoryEntry(tvStation.OriginalNetworkID, tvStation.TransportStreamID, tvStation.ServiceID, eitEntry.StartTime, eitEntry.EventName, eitEntry.ContentType, eitEntry.ContentSubType); foreach (CategoryEntry oldEntry in categoryEntries) { if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID == newEntry.TransportStreamID && oldEntry.ServiceID == newEntry.ServiceID && oldEntry.StartTime == newEntry.StartTime) return; if (oldEntry.NetworkID > newEntry.NetworkID) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID > newEntry.TransportStreamID) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID == newEntry.TransportStreamID && oldEntry.ServiceID > newEntry.ServiceID) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } if (oldEntry.NetworkID == newEntry.NetworkID && oldEntry.TransportStreamID == newEntry.TransportStreamID && oldEntry.ServiceID == newEntry.ServiceID && oldEntry.StartTime > newEntry.StartTime) { categoryEntries.Insert(categoryEntries.IndexOf(oldEntry), newEntry); return; } } categoryEntries.Add(newEntry); }