/// <summary> /// Compares the content of all of the sections to ensure that the resources are used on all platforms. /// </summary> /// <param name="sections">Sections.</param> private StringResources.Section CombineSections(StringResources.Section[] sections) { Clear(); if (sections == null || sections.Length <= 0) { Error("Found and empty section when merging sections"); } var ret = new StringResources.Section() { name = sections[0].name }; var keys = new HashSet <string>(); foreach (var section in sections) { // Generate a union of all the keys in the sections. foreach (var key in section.resources.Keys) { keys.Add(key); } } foreach (var key in keys) { Clear(); var options = new List <string>(); var ib = new InputBuilder(); var i = 0; foreach (var section in sections) { if (section.ContainsKey(key)) { options.Add(section.resources[key]); ib.AddAction(i++ + "", section.resources[key], () => { ret.resources[key] = section.resources[key]; }); } } var similar = true; for (int j = 1; j < options.Count; j++) { if (!sections[0].ContainsKey(key) || !sections[j].ContainsKey(key) || (!sections[0].resources[key].Equals(sections[j].resources[key]))) { similar = false; break; } } if (!similar) { // We need to ask the user which option to use. // We need to build the actions list. ib.AddAction(i++ + "", "Use keep both (do this only when there is a distinction between platform strings)", () => { WL("Failed to keep both"); }); WL("Found multiple values for key [" + key + "]"); context.RequestListItemSelection("Please select the value that the key should be.", ib); } } return(ret); }