Extentions

Extension methods to create configurations easier.

Type: Class
Namespace: ReCaptcha.Desktop.WPF.Configuration
Assembly: ReCaptcha.Desktop.WPF

public static class Extentions

Methods

AsReCaptchaConfig

Creates a new ReCaptchaConfig.

Returns: A new AsReCaptchaConfig.

public static ReCaptchaConfig AsReCaptchaConfig(
    this string siteKey,
    string hostName,
    string language = "en",
    string tokenRecievedHtml = "Token recieved: %token%",
    string tokenRecievedHookedHtml = "Token recieved and sent to application.",
    HttpServerConfig? httpConfiguration = null)
ParameterDescription
this string siteKeyThe SiteKey for the Google reCAPTCHA service.
string hostNameThe name of the virtual host on which the reCAPTCHA is hosted. Should represent your application.
string languageThe language for the Google reCAPTCHA service.
string tokenRecievedHtmlThe HTML which gets displayed after the user verifed the reCAPTCHA. Use %token% to embed the token inside the message.
string tokenRecievedHookedHtmlThe HTML which gets displayed after the user verifed the reCAPTCHA and its hooked to the application. Use %token% to embed the token inside the message.
HttpServerConfig? httpConfigurationThe configuration for the HttpServer.

AsWindowConfig

Creates a new AsWindowConfig.

Returns: A new AsWindowConfig.

public static WindowConfig AsWindowConfig(
    this string title,
    ImageSource icon = default!,
    Window? owner = null,
    bool showAsDialog = false,
    WindowStartupLocation startupLocation = WindowStartupLocation.CenterScreen,
    int left = 0,
    int top = 0)
ParameterDescription
this string titleThe title of the window.
ImageSource iconThe icon of the window.
Window? ownerThe owner of this window. (Only used for StartupLocation.CenterOwner).
bool showAsDialogWether to block the UI thread when showing the window.
WindowStartupLocation? startupLocationThe startup postion of the window.
int? leftThe left position of the window.
int? topThe top position of the window.