/// <summary> /// <para>Creates new PayPal "Subscribe" button widget.</para> /// </summary> /// <param name="html">Helper object to call method on.</param> /// <param name="builder">Delegate that performs configuration of the widget.</param> /// <returns>HTML contents of configured and rendered widget.</returns> /// <exception cref="ArgumentNullException">If either <paramref name="html"/> or <paramref name="builder"/> is a <c>null</c> reference.</exception> /// <seealso cref="IPayPalHtmlHelper.BuyGiftCertificate()"/> public static string SubscribeButton(this IPayPalHtmlHelper html, Action <IPayPalSubscribeWidget> builder) { Assertion.NotNull(html); Assertion.NotNull(builder); var widget = html.Subscribe(); builder(widget); return(widget.ToHtmlString()); }
/// <summary> /// <para>Creates new PayPal "Donate" button widget.</para> /// </summary> /// <param name="html">Helper object to call method on.</param> /// <param name="builder">Delegate that performs configuration of the widget.</param> /// <returns>HTML contents of configured and rendered widget.</returns> /// <exception cref="ArgumentNullException">If either <paramref name="html"/> or <paramref name="builder"/> is a <c>null</c> reference.</exception> /// <seealso cref="IPayPalHtmlHelper.BuyGiftCertificate()"/> public static string Donate(this IPayPalHtmlHelper html, Action <IPayPalDonateWidget> builder) { Assertion.NotNull(html); Assertion.NotNull(builder); var widget = html.Donate(); builder(widget); return(widget.ToHtmlString()); }
/// <summary> /// <para>Initializes HTML helper object for rendering of PayPal widgets.</para> /// </summary> /// <param name="html">Helper object to call method on.</param> /// <returns>Widgets factory helper.</returns> /// <exception cref="ArgumentNullException">If <paramref name="html"/> is a <c>null</c> reference.</exception> public static IPayPalHtmlHelper PayPal(this HtmlHelper html) { Assertion.NotNull(html); return paypal ?? (paypal = new PayPalHtmlHelper()); }
/// <summary> /// <para>Initializes HTML helper object for rendering of PayPal widgets.</para> /// </summary> /// <param name="html">Helper object to call method on.</param> /// <returns>Widgets factory helper.</returns> /// <exception cref="ArgumentNullException">If <paramref name="html"/> is a <c>null</c> reference.</exception> public static IPayPalHtmlHelper PayPal(this HtmlHelper html) { Assertion.NotNull(html); return(paypal ?? (paypal = new PayPalHtmlHelper())); }