/// <summary> /// <para>Creates new VKontakte "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="IVkontakteHtmlHelper.LikeButton()"/> public static string LikeButton(this IVkontakteHtmlHelper html, Action<IVkontakteLikeButtonWidget> builder) { Assertion.NotNull(html); Assertion.NotNull(builder); var widget = html.LikeButton(); builder(widget); return widget.ToHtmlString(); }
/// <summary> /// <para>Creates new VKontakte JavaScript API initialization 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="IVkontakteHtmlHelper.Initialize()"/> public static string Initialize(this IVkontakteHtmlHelper html, Action<IVkontakteInitializationWidget> builder) { Assertion.NotNull(html); Assertion.NotNull(builder); var widget = html.Initialize(); builder(widget); return widget.ToHtmlString(); }
/// <summary> /// <para>Creates new VKontakte community 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="IVkontakteHtmlHelper.Community()"/> public static string Community(this IVkontakteHtmlHelper html, Action<IVkontakteCommunityWidget> builder) { Assertion.NotNull(html); Assertion.NotNull(builder); var widget = html.Community(); builder(widget); return widget.ToHtmlString(); }
/// <summary> /// <para>Creates new VKontakte embedded video 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="IVkontakteHtmlHelper.Video()"/> public static string Video(this IVkontakteHtmlHelper html, Action<IVkontakteVideoWidget> builder) { Assertion.NotNull(html); Assertion.NotNull(builder); var widget = html.Video(); builder(widget); return widget.ToHtmlString(); }
/// <summary> /// <para>Creates new VKontakte Recommendations 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="IVkontakteHtmlHelper.Recommendations()"/> public static string Recommendations(this IVkontakteHtmlHelper html, Action<IVkontakteRecommendationsWidget> builder) { Assertion.NotNull(html); Assertion.NotNull(builder); var widget = html.Recommendations(); builder(widget); return widget.ToHtmlString(); }
/// <summary> /// <para>Initializes HTML helper object for rendering of Vkontakte 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 IVkontakteHtmlHelper Vkontakte(this HtmlHelper html) { Assertion.NotNull(html); return(vkontakte ?? (vkontakte = new VkontakteHtmlHelper())); }