public static void WriteExtensions <T>(this IFubuPage <T> page) where T : class
 {
     page.Get <ContentExtensionGraph>().ApplyExtensions(page);
 }
 public static IHtmlString PartialFor(this IFubuPage page, object input, bool withModelBinding = false, string categoryOrHttpMethod = null)
 {
     return(new HtmlString(page.Get <IPartialInvoker>().InvokeObject(input, withModelBinding, categoryOrHttpMethod)));
 }
 public static string InvokePartial <TInputModel>(IFubuPage page, string prefix, string categoryOrHttpMethod = null) where TInputModel : class
 {
     return(page.Get <IPartialInvoker>().Invoke <TInputModel>(categoryOrHttpMethod));
 }
 // Tested manually
 public static TagList CSS(this IFubuPage page, params string[] cssNames)
 {
     return(new TagList(page.Get <ICssLinkTagWriter>().Write(cssNames)));
 }
Exemple #5
0
 /// <summary>
 /// Exercises the IElementNamingConvention to determine the element name for an expression
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="page"></param>
 /// <param name="expression"></param>
 /// <returns></returns>
 public static string ElementNameFor <T>(this IFubuPage <T> page, Expression <Func <T, object> > expression)
     where T : class
 {
     return(page.Get <IElementNamingConvention>().GetName(typeof(T), expression.ToAccessor()));
 }
 public static string PartialFor(this IFubuPage page, object input)
 {
     return(page.Get <IPartialInvoker>().InvokeObject(input));
 }
 public static HtmlTag FormFor(this IFubuPage page, string url)
 {
     url = page.Get <IHttpRequest>().ToFullUrl(url);
     return(new FormTag(url).NoClosingTag());
 }
 /// <summary>
 /// "Require" script assets to be written later.  Useful to register scripts in partial
 /// views that need to be written by the master layout
 /// </summary>
 /// <param name="page"></param>
 /// <param name="scripts"></param>
 public static void RequireScript(this IFubuPage page, params string[] scripts)
 {
     page.Get <IAssetTagBuilder>().RequireScript(scripts);
 }
 /// <summary>
 ///   Returns the absolute URL for an image (may be a customer overridden path or a package image path)
 /// </summary>
 /// <param name = "viewPage"></param>
 /// <param name = "imageFilename">The name of the image file, relative to the applications' image folder</param>
 /// <returns></returns>
 public static string ImageUrl(this IFubuPage viewPage, string imageFilename)
 {
     return(viewPage.Get <IAssetTagBuilder>().FindImageUrl(imageFilename));
 }
Exemple #10
0
 public static void Notification <T>(this IFubuPage page, T notification)
     where T : class, INotificationModel
 {
     page.Get <PartialInvoker>().InvokeObject(notification);
 }
Exemple #11
0
        public static HtmlTag CreateImageFor(this IFubuPage page, string path)
        {
            var url = page.Get <IContentRegistry>().ImageUrl(path);

            return(new HtmlTag("img").Attr("src", url));
        }
Exemple #12
0
 /// <summary>
 ///   Returns the absolute URL for an image (may be a customer overridden path or a package image path)
 /// </summary>
 /// <param name = "viewPage"></param>
 /// <param name = "imageFilename">The name of the image file, relative to the applications' image folder</param>
 /// <returns></returns>
 public static string ImageUrl(this IFubuPage viewPage, string imageFilename)
 {
     return(viewPage.Get <IContentRegistry>().ImageUrl(imageFilename));
 }
 public static void Script(this IFubuPage page, string scriptName)
 {
     page.Get <ScriptRequirements>().Require(scriptName);
 }
 public static TagList WriteScriptTags(this IFubuPage page)
 {
     return(page.Get <ScriptIncludeWriter>().ScriptTags());
 }
Exemple #15
0
 public static bool InDevelopment(this IFubuPage page)
 {
     return(page.Get <FubuRuntime>().Mode.InDevelopment());
 }
 /// <summary>
 /// Writes out &lt;script&gt; tags for each script
 /// </summary>
 /// <param name="page"></param>
 /// <param name="scripts"></param>
 public static TagList Script(this IFubuPage page, params string[] scripts)
 {
     return(page.Get <IAssetTagBuilder>().BuildScriptTags(scripts).ToArray().ToTagList());
 }
Exemple #17
0
 public static string Version(this IFubuPage page)
 {
     return(page.Get <BehaviorGraph>().Version);
 }
 /// <summary>
 /// Writes out &lt;link&gt; tags for each stylesheet
 /// </summary>
 /// <param name="page"></param>
 /// <param name="cssNames"></param>
 public static TagList Css(this IFubuPage page, params string[] cssNames)
 {
     return(page.Get <IAssetTagBuilder>().BuildStylesheetTags(cssNames).ToArray().ToTagList());
 }
 public static string InvokePartial <TInputModel>(IFubuPage page, string prefix) where TInputModel : class
 {
     return(page.Get <IPartialInvoker>().Invoke <TInputModel>());
 }
 public static IHtmlString PartialFor(this IFubuPage page, object input, bool withModelBinding = false)
 {
     return(new HtmlString(page.Get <IPartialInvoker>().InvokeObject(input, withModelBinding)));
 }
        public static HtmlTag FormFor(this IFubuPage view, ChainSearch search, object input)
        {
            var request = new FormRequest(search, input);

            return(view.Get <ITagGeneratorFactory>().GeneratorFor <FormRequest>().Build(request));
        }
 public static void OptionalScript(this IFubuPage page, string scriptName)
 {
     page.Get <ScriptRequirements>().UseFileIfExists(scriptName);
 }