C# Class TwoFactorAuthNet.Providers.Qr.QrServerQrCodeProvider

Provides QR codes generated by GoQR.Me (qrserver.com).
Inheritance: BaseHttpQrCodeProvider, IQrCodeProvider
Show file Open project: RobThree/TwoFactorAuth.Net

Public Methods

Method Description
GetMimeType ( ) : string

Gets the MIME type of the image.

GetQrCodeImage ( string text, int size ) : byte[]

Downloads / retrieves / generates a QR code as image.

QrServerQrCodeProvider ( ) : System

Initializes a new instance of a QrServerQrCodeProvider with the default ErrorCorrectionLevel (F:TwoFactorAuthNet.Providers.Qr.ErrorCorrectionLevel.Low), Margin (4), QuietZone (1), BackgroundColor (Color.White), ForegroundColor (Color.Black), QrServerImageFormat">ImageFormat (RemoteCertificateValidationCallback.

QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel ) : System

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel and default Margin (4), QuietZone (1), BackgroundColor (Color.White), ForegroundColor (Color.Black), ImageFormat (QrServerImageFormat.Png) and RemoteCertificateValidationCallback.

QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin ) : System

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel and Margin and default QuietZone (1), BackgroundColor (Color.White), ForegroundColor (Color.Black), ImageFormat (QrServerImageFormat.Png) and RemoteCertificateValidationCallback.

QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone ) : System

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin and QuietZone and default BackgroundColor (Color.White), ForegroundColor (Color.Black), ImageFormat (QrServerImageFormat.Png) and RemoteCertificateValidationCallback.

QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone, Color backgroundColor ) : System

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin, QuietZone and BackgroundColor and default ForegroundColor (Color.Black), QrServerImageFormat">ImageFormat (RemoteCertificateValidationCallback.

QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone, Color backgroundColor, Color foregroundColor ) : System

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin, QuietZone, BackgroundColor and ForegroundColor and default QrServerImageFormat">ImageFormat (RemoteCertificateValidationCallback.

QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone, Color backgroundColor, Color foregroundColor, QrServerImageFormat imageFormat ) : System

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin, QuietZone, BackgroundColor, ForegroundColor, ImageFormat and default RemoteCertificateValidationCallback.

QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone, Color backgroundColor, Color foregroundColor, QrServerImageFormat imageFormat, RemoteCertificateValidationCallback remoteCertificateValidationCallback ) : System

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin, QuietZone, BackgroundColor, ForegroundColor, QrServerImageFormat">ImageFormat and

Private Methods

Method Description
GetUri ( string qrText, int size ) : Uri

Builds an Uri based on the instance's BaseHttpQrCodeProvider.BaseUri.

Method Details

GetMimeType() public method

Gets the MIME type of the image.
/// Thrown when an unknown is used. ///
public GetMimeType ( ) : string
return string

GetQrCodeImage() public method

Downloads / retrieves / generates a QR code as image.
public GetQrCodeImage ( string text, int size ) : byte[]
text string The text to encode in the QR code.
size int The desired size (width and height equal) for the image.
return byte[]

QrServerQrCodeProvider() public method

Initializes a new instance of a QrServerQrCodeProvider with the default ErrorCorrectionLevel (F:TwoFactorAuthNet.Providers.Qr.ErrorCorrectionLevel.Low), Margin (4), QuietZone (1), BackgroundColor (Color.White), ForegroundColor (Color.Black), QrServerImageFormat">ImageFormat (RemoteCertificateValidationCallback.
public QrServerQrCodeProvider ( ) : System
return System

QrServerQrCodeProvider() public method

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel and default Margin (4), QuietZone (1), BackgroundColor (Color.White), ForegroundColor (Color.Black), ImageFormat (QrServerImageFormat.Png) and RemoteCertificateValidationCallback.
public QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel ) : System
errorCorrectionLevel ErrorCorrectionLevel The to use when generating QR codes.
return System

QrServerQrCodeProvider() public method

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel and Margin and default QuietZone (1), BackgroundColor (Color.White), ForegroundColor (Color.Black), ImageFormat (QrServerImageFormat.Png) and RemoteCertificateValidationCallback.
public QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin ) : System
errorCorrectionLevel ErrorCorrectionLevel The to use when generating QR codes.
margin int The to be used for the QR code.
return System

QrServerQrCodeProvider() public method

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin and QuietZone and default BackgroundColor (Color.White), ForegroundColor (Color.Black), ImageFormat (QrServerImageFormat.Png) and RemoteCertificateValidationCallback.
public QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone ) : System
errorCorrectionLevel ErrorCorrectionLevel The to use when generating QR codes.
margin int The to be used for the QR code.
quietZone int The to be used for the QR code.
return System

QrServerQrCodeProvider() public method

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin, QuietZone and BackgroundColor and default ForegroundColor (Color.Black), QrServerImageFormat">ImageFormat (RemoteCertificateValidationCallback.
public QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone, Color backgroundColor ) : System
errorCorrectionLevel ErrorCorrectionLevel The to use when generating QR codes.
margin int The to be used for the QR code.
quietZone int The to be used for the QR code.
backgroundColor Color The background color to be used for the QR code.
return System

QrServerQrCodeProvider() public method

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin, QuietZone, BackgroundColor and ForegroundColor and default QrServerImageFormat">ImageFormat (RemoteCertificateValidationCallback.
public QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone, Color backgroundColor, Color foregroundColor ) : System
errorCorrectionLevel ErrorCorrectionLevel The to use when generating QR codes.
margin int The to be used for the QR code.
quietZone int The to be used for the QR code.
backgroundColor Color The background color to be used for the QR code.
foregroundColor Color The foreground color to be used for the QR code.
return System

QrServerQrCodeProvider() public method

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin, QuietZone, BackgroundColor, ForegroundColor, ImageFormat and default RemoteCertificateValidationCallback.
public QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone, Color backgroundColor, Color foregroundColor, QrServerImageFormat imageFormat ) : System
errorCorrectionLevel ErrorCorrectionLevel The to use when generating QR codes.
margin int The to be used for the QR code.
quietZone int The to be used for the QR code.
backgroundColor Color The background color to be used for the QR code.
foregroundColor Color The foreground color to be used for the QR code.
imageFormat QrServerImageFormat The of the QR code.
return System

QrServerQrCodeProvider() public method

Initializes a new instance of a QrServerQrCodeProvider with the specified ErrorCorrectionLevel, Margin, QuietZone, BackgroundColor, ForegroundColor, QrServerImageFormat">ImageFormat and
/// Thrown when an invalid or is specified, /// is less than 0 or more than 50 or is less than 0 or /// more than 100. ///
public QrServerQrCodeProvider ( ErrorCorrectionLevel errorCorrectionLevel, int margin, int quietZone, Color backgroundColor, Color foregroundColor, QrServerImageFormat imageFormat, RemoteCertificateValidationCallback remoteCertificateValidationCallback ) : System
errorCorrectionLevel ErrorCorrectionLevel The to use when generating QR codes.
margin int The to be used for the QR code.
quietZone int The to be used for the QR code.
backgroundColor Color The background color to be used for the QR code.
foregroundColor Color The foreground color to be used for the QR code.
imageFormat QrServerImageFormat The of the QR code.
remoteCertificateValidationCallback RemoteCertificateValidationCallback /// The to use when generating QR codes. ///
return System