/// <summary> /// Load the ATSC collection from the tuning files. /// </summary> /// <param name="directoryName">The full path of the directory containing the tuning files.</param> public static void Load(string directoryName) { Providers.Clear(); DirectoryInfo directoryInfo = new DirectoryInfo(directoryName); foreach (FileInfo fileInfo in directoryInfo.GetFiles("*.xml")) { AtscProvider atscProvider = new AtscProvider(fileInfo.Name.Substring(0, fileInfo.Name.Length - 4)); atscProvider.load(fileInfo); AddProvider(atscProvider); } }
/// <summary> /// Add a provider to the list. /// </summary> /// <param name="newProvider">The provider to be added.</param> public static void AddProvider(AtscProvider newProvider) { foreach (AtscProvider oldProvider in Providers) { if (oldProvider.Name == newProvider.Name) { return; } if (oldProvider.Name.CompareTo(newProvider.Name) > 0) { Providers.Insert(Providers.IndexOf(oldProvider), newProvider); return; } } Providers.Add(newProvider); }
/// <summary> /// Add a provider to the list. /// </summary> /// <param name="newProvider">The provider to be added.</param> public static void AddProvider(AtscProvider newProvider) { foreach (AtscProvider oldProvider in Providers) { if (oldProvider.Name == newProvider.Name) return; if (oldProvider.Name.CompareTo(newProvider.Name) > 0) { Providers.Insert(Providers.IndexOf(oldProvider), newProvider); return; } } Providers.Add(newProvider); }