public static MvcHtmlString AddPageEditing(this HtmlHelper html) { if (ModeProvider == null) { ModeProvider = DependencyResolver.Current.GetService<IModeProvider>(); } if (ModeProvider.GetIsPageEditing(html.ViewContext.HttpContext) != true) { return null; } if(AddPageEditingHtmlGenerator == null) { AddPageEditingHtmlGenerator = DependencyResolver.Current.GetService<IAddPageEditingHtmlGenerator>(); } return MvcHtmlString.Create(AddPageEditingHtmlGenerator.GenerateHtml()); }
public static IHtmlContent AddPageEditing(this IHtmlHelper html) { if (ModeProvider == null) { ModeProvider = (IModeProvider)html.ViewContext.HttpContext.RequestServices.GetService(typeof(IModeProvider)); } if (ModeProvider.GetIsPageEditing(html.ViewContext.HttpContext) != true) { return(null); } if (AddPageEditingHtmlGenerator == null) { AddPageEditingHtmlGenerator = (IAddPageEditingHtmlGenerator)html.ViewContext.HttpContext.RequestServices.GetService(typeof(IAddPageEditingHtmlGenerator)); } return(new HtmlString(AddPageEditingHtmlGenerator.GenerateHtml())); }