Atomia.Web.Plugin.PublicOrder.Helpers.MasterPageLocationProviderImplementer.FetchMasterPageLocation C# (CSharp) Метод

FetchMasterPageLocation() публичный Метод

Fetches the master page location for a given plugin page(view).
public FetchMasterPageLocation ( string controller, string action, string area, string &location ) : bool
controller string The plugin controller.
action string The plugin action(view).
area string The plugin area.
location string The location of the master page (relative to the Theme\{theme_name} folder).
Результат bool
        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;
        }
MasterPageLocationProviderImplementer