Show / Hide Table of Contents

Class PuzzleKeypad

Provides methods for generation, storing, and interpretation of user actions with a keypad of random layout. This .ctor is supplied some code that user has to punch-in(touch/click) on a randomly laid-out keypad which is usually rendered as an image. Use DecipherCoordinates() methods to convert user click/touch coordinates into characters

Inheritance
System.Object
PuzzleKeypad
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.Security.CAPTCHA
Assembly: NFX.dll
Syntax
[Serializable]
public sealed class PuzzleKeypad

Constructors

PuzzleKeypad(String, String, Int32, Int32, Int32, Double, Int32, Int32)

Declaration
public PuzzleKeypad(string code, string extra = null, int puzzleBoxWidth = 5, int boxWidth = 35, int boxHeight = 50, double boxSizeVariance = 0.3, int minBoxWidth = 10, int minBoxHeight = 16)
Parameters
Type Name Description
System.String code
System.String extra
System.Int32 puzzleBoxWidth
System.Int32 boxWidth
System.Int32 boxHeight
System.Double boxSizeVariance
System.Int32 minBoxWidth
System.Int32 minBoxHeight

Fields

DEFAULT_RENDER_OFFSET_X

Declaration
public const int DEFAULT_RENDER_OFFSET_X = 16
Field Value
Type Description
System.Int32

DEFAULT_RENDER_OFFSET_Y

Declaration
public const int DEFAULT_RENDER_OFFSET_Y = 16
Field Value
Type Description
System.Int32

Properties

Boxes

Returns char boxes

Declaration
public IEnumerable<PuzzleKeypad.CharBox> Boxes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<PuzzleKeypad.CharBox>

Code

Returns the original secret code that this keypad was created for

Declaration
public string Code { get; }
Property Value
Type Description
System.String

Size

Returns the size of rectangle that covers all boxes

Declaration
public Size Size { get; }
Property Value
Type Description
System.Drawing.Size

Methods

DecipherCoordinates(JSONDataArray, Nullable<Int32>, Nullable<Int32>)

Translates user action coordinates (i.e. screen touches or mouse clicks) into a string. The coordinates must be supplied as a JSON array of json objects that have '{x: [int], y: [int]}' structure

Declaration
public string DecipherCoordinates(JSONDataArray coords, int ? offsetX = default (int ? ), int ? offsetY = default (int ? ))
Parameters
Type Name Description
JSONDataArray coords
System.Nullable<System.Int32> offsetX
System.Nullable<System.Int32> offsetY
Returns
Type Description
System.String

DecipherCoordinates(IEnumerable<Point>, Nullable<Int32>, Nullable<Int32>)

Translates user action coordinates (i.e. screen touches or mouse clicks) into a string. The coordinates are supplied as IEnumerable(Point)

Declaration
public string DecipherCoordinates(IEnumerable<Point> coords, int ? offsetX = default (int ? ), int ? offsetY = default (int ? ))
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Drawing.Point> coords
System.Nullable<System.Int32> offsetX
System.Nullable<System.Int32> offsetY
Returns
Type Description
System.String

DefaultRender(Nullable<Color>, Boolean)

Renders default image of the keypad suitable for user entry (i.e. touch or mouse clicks). This method requires IPuzzleKeypadRenderer module to be installed in application module root

Declaration
public Image DefaultRender(Color? bgColor = default (Color? ), bool showRects = false)
Parameters
Type Name Description
System.Nullable<System.Drawing.Color> bgColor
System.Boolean showRects
Returns
Type Description
Image

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX