private static void Identify(List <KmlItem> list) { for (int i = 0; i < list.Count; i++) { KmlItem item = list[i]; KmlItem replaceItem = item.Identify(); if (replaceItem != null) { list[i] = replaceItem; } } }
private static void Identify(List <KmlItem> list, bool recursive = false) { for (int i = 0; i < list.Count; i++) { KmlItem item = list[i]; if (recursive && item is KmlNode) { KmlNode node = (KmlNode)item; Identify(node.AllItems, recursive); } KmlItem replaceItem = item.Identify(); if (replaceItem != null) { list[i] = replaceItem; } } }