/// <summary>
        /// Returns a string representation of <see cref="QRErrorCorrectionLevel"/> enum value.
        /// </summary>
        /// <param name="item">An enum value.</param>
        /// <returns>A string representation of enum value.</returns>
        internal static string QRErrorCorrectionLevelToString(QRErrorCorrectionLevel item)
        {
            switch (item)
            {
            case QRErrorCorrectionLevel.L:
                return("L");

            case QRErrorCorrectionLevel.M:
                return("M");

            case QRErrorCorrectionLevel.Q:
                return("Q");

            case QRErrorCorrectionLevel.H:
                return("H");
            }
            return(null);
        }
示例#2
0
        /// <summary>
        /// Sets the error correction level of the QR code.
        /// </summary>
        /// <param name="errorCorrection">The QR code error correction level.</param>
        /// <example>
        /// <code lang="Razor">
        /// @(Html.Kendo().QRCode()
        ///     .Name(&quot;qrCode&quot;)
        ///     .ErrorCorrection(QRErrorCorrectionLevel.Q)
        /// )
        /// </code>
        /// <code lang="ASPX">
        /// &lt;%:Html.Kendo().QRCode()
        ///     .Name(&quot;qrCode&quot;)
        ///     .ErrorCorrection(QRErrorCorrectionLevel.Q)
        /// %&gt;
        /// </code>
        /// </example>
        public QRCodeBuilder ErrorCorrection(QRErrorCorrectionLevel errorCorrection)
        {
            Component.ErrorCorrection = errorCorrection;

            return(this);
        }