1
Vote

SingleFileGenerator generates only the first dependent file

description

The method InvokeGenerator(FileNode fileNode) in the class SingleFileGenerator always generate the first file which depends on the main file. Since more than one file could depend on a file we have to fint the correct file to generate. Fix this with the following code:
 
while(dependentNode != null)
{
if (dependentNodeName == ((FileNode)dependentNode).FileName // ADDED LE: Lesta you can have more than one file which DependentUpon filenode but only the first one was generated e.g. a *.diagram file and a code file
    && string.Compare(dependentNode.ItemNode.GetMetadata(ProjectFileConstants.DependentUpon), fileNode.FileName, StringComparison.OrdinalIgnoreCase) == 0)
{
    dependentNodeName = ((FileNode)dependentNode).FileName;
    break;
}
 
dependentNode = dependentNode.NextSibling;
}

comments