示例#1
0
        public ActionResult Hilfe(string actionName, string controllerName, string areaName)
        {
            string cultureCode = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName;

            var languageIndependentHelpFilePath = HelpFileMappingStore.GetHelpFilePath(GetHelpFileKey(actionName, controllerName, areaName), cultureCode);

            string helpFilePath = null;

            if (!string.IsNullOrEmpty(languageIndependentHelpFilePath))
            {
                helpFilePath = string.Format("~/Help/{0}/{1}", cultureCode, languageIndependentHelpFilePath);
            }

            if (helpFilePath == null)
            {
                helpFilePath = GetHelpFilePath(cultureCode, actionName, controllerName, areaName);
            }

            if (!System.IO.File.Exists(Server.MapPath(helpFilePath)))
            {
                helpFilePath = string.Format("~/Help/{0}/{1}", cultureCode, HelpFileMappingStore.GetContentsPath(cultureCode));
            }

            ViewBag.HelpUrl = new UrlHelper(ControllerContext.RequestContext).Content(helpFilePath);
            return(View());
        }