internal void AddFfuToRepository(string FFUPath, string PlatformID, string FirmwareVersion, string OSVersion) { FFUEntry Entry = FFURepository.Where(e => ((e.PlatformID == PlatformID) && (e.FirmwareVersion == FirmwareVersion) && (string.Compare(e.Path, FFUPath, true) == 0))).FirstOrDefault(); if (Entry == null) { LogFile.Log("Adding FFU to repository: " + FFUPath, LogType.FileAndConsole); LogFile.Log("Platform ID: " + PlatformID, LogType.FileAndConsole); if (FirmwareVersion != null) { LogFile.Log("Firmware version: " + FirmwareVersion, LogType.FileAndConsole); } if (OSVersion != null) { LogFile.Log("OS version: " + OSVersion, LogType.FileAndConsole); } Entry = new FFUEntry(); Entry.Path = FFUPath; Entry.PlatformID = PlatformID; Entry.FirmwareVersion = FirmwareVersion; Entry.OSVersion = OSVersion; FFURepository.Add(Entry); WriteConfig(); } else { LogFile.Log("FFU not added, because it was already present in the repository.", LogType.FileAndConsole); } }
internal void RemoveFfuFromRepository(string FFUPath) { int Count = 0; FFURepository.Where(e => (string.Compare(e.Path, FFUPath, true) == 0)).ToList().ForEach(e => { Count++; FFURepository.Remove(e); }); if (Count == 0) { LogFile.Log("FFU was not removed from repository because it was not present.", LogType.FileAndConsole); } else { LogFile.Log("Removed FFU from repository: " + FFUPath, LogType.FileAndConsole); WriteConfig(); } }