private void VerifySatelites(List <ResourceItem> itemList) { Dictionary <string, ResourceItem> items = new Dictionary <string, ResourceItem>(itemList.Count); itemList.ForEach(i => items.Add(i.Name, i)); string mainFile = this.fileName; Action <string> unknownResource = name => this.Warning(name, "resource does not exist in the main resource file \"{0}\"", mainFile); foreach (string file in this.satelites) { XmlDocument resource = new XmlDocument(); resource.Load(file); XmlNodeList nodeList = ResourceParser.SelectResources(resource); if (nodeList != null && 0 < nodeList.Count) { this.fileName = file; this.Parse(nodeList, (string name, string value, string comment) => { ResourceItem item; if (items.TryGetValue(name, out item)) { ResourceItem satellite = this.GenerateInclude(name, value, comment); if (item.Type != satellite.Type) { this.Error(name, "type of file resource is different in main resource file \"{0}\" and language resource file \"{1}\"", mainFile, file); } } else { unknownResource(name); } }, (string name, string value, string comment) => { ResourceItem item; if (items.TryGetValue(name, out item)) { if (!item.SuppressValidation) { int count = this.ValidateFormatItems(name, value, false); if (count != (item.Parameters == null ? 0 : item.Parameters.Count)) { this.Warning(name, "number of parameters is different from the same resource in the main resource file \"{0}\"", mainFile); } else if (item.LocalizationVariants != null) { if (!item.LocalizationVariants.Contains(value)) { this.Error(name, "provided value is not in variant list defined in main resource file: \"{0}\"", mainFile); } } } } else { unknownResource(name); } } ); } } this.fileName = mainFile; }