private bool IsСompatibleInterface(Collection <ListBoxObject> collection, VideoCard videoСard, string problem_report) { bool isValid = false; MotherboardProperties motherboard = (GetSingleItem(collection, "motherboard") as Motherboard).Properties; switch (GetCount(collection, "video_card")) { case 0: if (videoСard.IsCompatibility(motherboard)) { isValid = true; } break; default: { for (int i = 0; i > collection.Where(m => m.Item.GetTypeValue() == "video_card").Count(); i++) { VideoCard cVideoСard = collection[i].IObject as VideoCard; int mon_videoInterfaces = cVideoСard.Compatibility(((GetSingleItem(collection, "motherboard") as Motherboard).Properties)); if (mon_videoInterfaces > 1) { if (cVideoСard.IsCompatibility(motherboard)) { isValid = true; break; } } } break; } } if (!isValid) { ProblemReport(problem_report); } return(isValid); }