AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="0.10.1" />

 BaseInputType

public abstract class BaseInputType
Base type for the all input field types. Primarely from: http://www.w3.org/TR/html5/forms.html#range-state-(type=range)
protected static readonly Regex Number

Simple regular expression for floating point numbers.

protected static readonly DateTime UnixEpoch

The start of the unix epoch (1st of January 1970).

public bool CanBeValidated { get; }

Gets if the input type can be validated.

public IHtmlInputElement Input { get; }

Gets the associated input element.

public string Name { get; }

Gets the name of the input type.

public BaseInputType(IHtmlInputElement input, string name, bool validate)

Creates a new base input type.

protected static int FetchDigits(string value)

Skips all legit digits while returning the final position.

Converts the given validity state to a validation error enum.

protected static int GetWeekOfYear(DateTime value)

Tries to convert the value to a week.

protected static bool IsInvalidPattern(string pattern, string value)

Checks if the string does not follow the pattern.

protected static bool IsLegalDay(int day, int month, int year)

Checks if the given values form a legal date.

protected static bool IsLegalHour(int value)

Checks if the given value is a legal hour.

protected static bool IsLegalMinute(int value)

Checks if the given value is a legal minute.

protected static bool IsLegalMonth(int value)

Checks if the given value is a legal month.

protected static bool IsLegalSecond(int value)

Checks if the given value is a legal second.

protected static bool IsLegalWeek(int week, int year)

Checks if the given values form a legal week.

protected static bool IsLegalYear(int value)

Checks if the given value is a legal year.

protected static bool IsTimeSeparator(char chr)

Checks if the given character is a valid time separator.

protected static bool PositionIsValidForDateTime(string value, int position)

Checks the assumption that the string continues with a date time.

protected static double? ToNumber(string value)

Tries to convert the value to a number using the default expression.

protected static TimeSpan? ToTime(string value, ref int position)

Tries to convert the value to a time starting at the given position.

public virtual ValidationErrors Check(IValidityState current)

Checks the current input for its validity.

protected ValidationErrors CheckTime(IValidityState state, string value, DateTime? date, DateTime? min, DateTime? max)

Validates the time using the given parameters.

public virtual void ConstructDataSet(FormDataSet dataSet)

Populates the form data set with the current input.

public virtual string ConvertFromDate(DateTime value)

Tries to convert the given date time to a string.

public virtual string ConvertFromNumber(double value)

Tries to convert the given number to a string.

public virtual DateTime? ConvertToDate(string value)

Tries to convert the given string to a date time.

public virtual double? ConvertToNumber(string value)

Tries to convert the given string to a number.

public virtual void DoStep(int n)

Changes the value by n steps.

protected virtual double GetDefaultStep()

Gets the default step size.

protected virtual double GetDefaultStepBase()

Gets the default step offset.

protected double GetStep()

Gets the current step size.

protected virtual double GetStepScaleFactor()

Gets the step scaling factor.

public virtual bool IsAppendingData(IHtmlElement submitter)

Checks if the given type wants to append data.

protected bool IsStepMismatch()

Checks if the current value does not match the steps.