The key is only unique per resource file, and there is no demand to have a specific prefix to distinguish it from other names. I had projects where e.g. one key was "System", and it found hundreds of matches when looking only for the key.
Also looking for the class name first speeds up the search a bit.
I have already added code looking for a special key that we use when generating some code with text templates:
Also looking for the class name first speeds up the search a bit.
I have already added code looking for a special key that we use when generating some code with text templates:
foreach (var sourceFile in sourceFiles.Where(file => file.FileKind != FileKind.Undefined))
{
Contract.Assume(sourceFile != null);
FindCodeReferences(sourceFile, @"StringResourceKey", resourceTableEntries);
}
So you could add something like foreach (var sourceFile in sourceFiles)
{
Contract.Assume(sourceFile != null);
FindCodeReferences(sourceFile, @"LOC", resourceTableEntries);
}
and extend the function IsValidClassValueDeclaration
so it matches your pattern.