public bool FetchMasterPageLocation(string controller, string action, string area, out string location)
{
if (String.IsNullOrEmpty(controller) || String.IsNullOrEmpty(action))
{
location = String.Empty;
return false;
}
if (!PluginLoaderHelper.PopulateMasterPageLocation(Base.Configs.AppConfig.Instance.MasterPageLocationsList, controller, action, area, false, out location))
{
// we didn't find the master page location in global config file, trying to find in the plugin config file
string currentDir = Directory.GetCurrentDirectory();
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
System.Configuration.Configuration config = PluginLoaderHelper.GetConfigFile(
PluginConfigurationHelper.GetAssemblyFilePath(codeBase),
PluginConfigurationHelper.GetConfigFilePath(codeBase));
bool foundLocation = false;
try
{
foundLocation = PluginLoaderHelper.PopulateMasterPageLocation(Base.Configs.AppConfig.GetAppConfigSection(config).MasterPageLocationsList, controller, action, area, true, out location);
}
catch (Exception e)
{
OrderPageLogger.LogOrderPageException(e);
}
finally
{
Directory.SetCurrentDirectory(currentDir);
}
return foundLocation;
}
return true;
}