Example #1
0
        /// <summary>
        ///   <para>Requests QR code format for user's profile data.</para>
        /// </summary>
        /// <param name="widget">Widget to call method on.</param>
        /// <param name="size">Edge length in pixels of the desired QR code image.</param>
        /// <returns>Reference to provided <paramref name="widget"/>.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="widget"/> is a <c>null</c> reference.</exception>
        /// <seealso cref="IGravatarProfileUrlWidget.Format(string)"/>
        public static IGravatarProfileUrlWidget Qr(this IGravatarProfileUrlWidget widget, short?size = null)
        {
            Assertion.NotNull(widget);

            if (size != null)
            {
                widget.Parameter("size", size);
            }

            return(widget.Format("qr"));
        }
Example #2
0
        /// <summary>
        ///   <para>Requests JSON format for user's profile data.</para>
        /// </summary>
        /// <param name="widget">Widget to call method on.</param>
        /// <param name="callback">Callback JavaScript function to be wrapped around the resulting JSON object.</param>
        /// <returns>Reference to provided <paramref name="widget"/>.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="widget"/> is a <c>null</c> reference.</exception>
        /// <seealso cref="IGravatarProfileUrlWidget.Format(string)"/>
        public static IGravatarProfileUrlWidget Json(this IGravatarProfileUrlWidget widget, string callback = null)
        {
            Assertion.NotNull(widget);

            if (!callback.IsEmpty())
            {
                widget.Parameter("callback", callback);
            }

            return(widget.Format("json"));
        }
Example #3
0
        /// <summary>
        ///   <para>Requests VCF/vCard format for user's profile data.</para>
        /// </summary>
        /// <param name="widget">Widget to call method on.</param>
        /// <returns>Reference to provided <paramref name="widget"/>.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="widget"/> is a <c>null</c> reference.</exception>
        /// <seealso cref="IGravatarProfileUrlWidget.Format(string)"/>
        public static IGravatarProfileUrlWidget Vcf(this IGravatarProfileUrlWidget widget)
        {
            Assertion.NotNull(widget);

            return(widget.Format("vcf"));
        }