I'm working on a project that provides third party developers with an API containing template classes they can inherit from. This developer must inform the main process that they've created a type that inherits from one of those templates. To do this, the developer calls a function:
internal Dictionary<string, Type> Templates = new Dictionary<string, Type>();
public void RegisterTemplate(string ID, Type template)
{
...
Templates.Add(ID, template);
...
}
Note: RegisterTemplate is a member of the program, not of an external library.
Functions in the type a developer provides in to this function call relative paths such as "Audio/somefile.wav" or "Models/somefile.vox". The third party developer compiles their inheriting classes into a DLL and places it in a folder separate from the program in order to be imported later by the program.
If the program calls the functions described in bold above, will the path associated be relative to the program that invokes the Type, or relative to the DLL that the invoked Type originates from?
To Clarify: rather than the relative paths of the executing assembly or DLL, I'm talking in regards to the paths called within the DLL, like so:
File.Open("Audio/somefile.wav");
If this code is called from a function within the DLL, and the type that contains this code is invoked by code in my executable, will this path be relative to the executable that invoked the Type, or the DLL that contains the invoked Type?
Aucun commentaire:
Enregistrer un commentaire