private void identifyMatchingRoms() { // Reset the sync status for both input and output roms - when you sync one rom, you have to update both sides. foreach (Rom r in InputRoms) { r.SyncStatus = 0; } foreach (Rom r in OutputRoms) { r.SyncStatus = 0; } // Find input roms that match output roms IEnumerable <Rom> inputRomsMatchingOutputRoms = InputRoms.Intersect <Rom>(OutputRoms); foreach (Rom match in inputRomsMatchingOutputRoms) { match.SyncStatus = 1; } // Find output roms that match input roms (remember - these two lists are separate.) IEnumerable <Rom> outputRomsMatchingInputRoms = OutputRoms.Intersect <Rom>(InputRoms); foreach (Rom match in outputRomsMatchingInputRoms) { match.SyncStatus = 1; } }
private void populateRomList(string directory, bool useInputRoms) { // Clear applicable rom list if (useInputRoms) { InputRoms.Clear(); Debug.WriteLine("Cleared input roms."); FileInfo[] fileInfos = new DirectoryInfo(directory).GetFiles(); foreach (FileInfo f in fileInfos) { InputRoms.Add(new Rom(f)); } Debug.WriteLine("Input roms were added. A total of " + InputRoms.Count); } else { OutputRoms.Clear(); Debug.WriteLine("Cleared output roms."); FileInfo[] fileInfos = new DirectoryInfo(directory).GetFiles(); foreach (FileInfo f in fileInfos) { OutputRoms.Add(new Rom(f)); } Debug.WriteLine("Output roms were added. A total of " + OutputRoms.Count); } }