I have a separate application (that is, to check the spelling of my .resx files) that fires as a pre-build event. However, if the .resx file contains a text file (e.g. xml), my application will download the file and try to check it. In fact, I do not want to do this. Is there any way to tell from ResXResourceReader if the loaded resource is actually a file?
Sample code is as follows:
ResXResourceReader reader = new ResXResourceReader(filename); ResourceSet resourceset = new ResourceSet(reader); Dictionary<DictionaryEntry, object> newvalues = new Dictionary<DictionaryEntry, object>(); foreach (DictionaryEntry entry in resourceset) { //Figure out in this 'if' if it is an embedded file and should be ignored. if (entry.Key.ToString().StartsWith(">>") || !(entry.Value is string) || string.Compare((string)entry.Value, "---") == 0) continue; }
source share