コード例 #1
0
        /// <summary>
        /// Renders a partial view in the current theme based on the current IMasterModel
        /// </summary>
        /// <param name="html"></param>
        /// <param name="model"></param>
        /// <param name="partialName"></param>
        /// <param name="viewModel"></param>
        /// <param name="viewData"></param>
        /// <returns></returns>
        public static IHtmlString ThemedPartial(this HtmlHelper html, IMasterModel model, string partialName, object viewModel, ViewDataDictionary viewData = null)
        {
            var path = PathHelper.GetThemePartialViewPath(model, partialName);

            return(html.Partial(path, viewModel, viewData));
        }
コード例 #2
0
 public static HtmlHelper RequiresThemedJs(this HtmlHelper html, IMasterModel model, string filePath)
 {
     return(html.RequiresJs(PathHelper.GetThemePath(model) + "Assets/js" + filePath.EnsureStartsWith('/')));
 }
コード例 #3
0
 public static HtmlHelper RequiresThemedJsFolder(this HtmlHelper html, IMasterModel model)
 {
     return(html.RequiresJsFolder(PathHelper.GetThemePath(model) + "Assets/js"));
 }
コード例 #4
0
 /// <summary>
 /// Returns the url of a themed asset
 /// </summary>
 /// <param name="url"></param>
 /// <param name="model"></param>
 /// <param name="relativeAssetPath"></param>
 /// <returns></returns>
 public static string ThemedAsset(this UrlHelper url, IMasterModel model, string relativeAssetPath)
 {
     return(VirtualPathUtility.ToAbsolute(PathHelper.GetThemePath(model)).EnsureEndsWith('/') + "assets/" + relativeAssetPath);
 }