AngleSharp by AngleSharp

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

.NET API 1,232,384 bytes

 ObjectExtensions

static class ObjectExtensions
Some methods for working with bare objects.
public static double Constraint(this double value, double min, double max)

Constraints the given value between the min and max values.

public static string GetMessage<T>(this T code) where T : struct

Retrieves a string describing the error of a given error code.

public static U GetOrDefault<T, U>(this IDictionary<T, U> values, T key, U defaultValue)

Gets the value of the given key, otherwise the provided default value.

public static Dictionary<string, string> ToDictionary(this object values)

Transforms the values of the object into a dictionary of strings.

public static T? TryGet<T>(this IDictionary<string, object> values, string key) where T : struct

Tries to obtain the given key, otherwise returns the default value.

public static object TryGet(this IDictionary<string, object> values, string key)

Tries to obtain the given key, otherwise returns null.