Ejemplo n.º 1
0
        /// <summary>
        ///   <para>Creates new Yandex.Money payment form 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>
        public static string MoneyPaymentForm(this IYandexHtmlHelper html, Action <IYandexMoneyPaymentFormWidget> builder)
        {
            Assertion.NotNull(html);
            Assertion.NotNull(builder);

            var widget = html.MoneyPaymentForm();

            builder(widget);
            return(widget.ToHtmlString());
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   <para>Creates new Yandex "Like" 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="IYandexHtmlHelper.LikeButton()"/>
        public static string LikeButton(this IYandexHtmlHelper html, Action <IYandexLikeButtonWidget> builder)
        {
            Assertion.NotNull(html);
            Assertion.NotNull(builder);

            var widget = html.LikeButton();

            builder(widget);
            return(widget.ToHtmlString());
        }
Ejemplo n.º 3
0
        /// <summary>
        ///   <para>Creates new Yandex.Metrika analytics 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="IYandexHtmlHelper.Analytics()"/>
        public static string Analytics(this IYandexHtmlHelper html, Action <IYandexAnalyticsWidget> builder)
        {
            Assertion.NotNull(html);
            Assertion.NotNull(builder);

            var widget = html.Analytics();

            builder(widget);
            return(widget.ToHtmlString());
        }
Ejemplo n.º 4
0
        /// <summary>
        ///   <para>Creates new Yandex "Share" 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="IYandexHtmlHelper.SharePanel()"/>
        public static string SharePanel(this IYandexHtmlHelper html, Action <IYandexSharePanelWidget> builder)
        {
            Assertion.NotNull(html);
            Assertion.NotNull(builder);

            var widget = html.SharePanel();

            builder(widget);
            return(widget.ToHtmlString());
        }
    /// <summary>
    ///   <para>Initializes HTML helper object for rendering of Yandex 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 IYandexHtmlHelper Yandex(this HtmlHelper html)
    {
      Assertion.NotNull(html);

      return yandex ?? (yandex = new YandexHtmlHelper());
    }
Ejemplo n.º 6
0
        /// <summary>
        ///   <para>Initializes HTML helper object for rendering of Yandex 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 IYandexHtmlHelper Yandex(this HtmlHelper html)
        {
            Assertion.NotNull(html);

            return(yandex ?? (yandex = new YandexHtmlHelper()));
        }