Directory.SetCurrentDirectory()

posted Jul 25, 2014, 3:18 PM by Lesley Bross
I reverted to my initial approach of creating a Validator class that implements the ICore interface. I found that the extensions use the ICore properties to store and share information. Unfortunately there were private variables in the Model class passed to the extensions that I could not manipulate from outside the class. I pass the Model to the constructor of the Validator and use it as much as possible as the source for the getters. I am somewhat uncertain about the state of the Validator ICore object using this approach but because it is only used for validation, I think it will be okay. My primary objective is to invoke the LoadParameters() method for each extension and I am accomplishing that.

As I've mentioned before LANDIS-II code that reads files assumes that the application is launched from the same directory that contains the configuration files. This is not the case with the Widgets UI. I needed to use Directory.SetCurrentDirectory() to set the current directory to the folder containing the scenario file. I did this when the Run event handlers but had forgotten to add it to the Validate handler. 
Comments