Show / Hide Table of Contents

Class ExtMisc

Adds extension methods for some .NET types.

public static class ExtMisc

Namespace: Au.Types
Assembly: Au.dll
Inheritance
object
ExtMisc

Methods

Name Description
AppendSentence(StringBuilder, string, bool)

Appends string as new correctly formatted sentence.

AsSpan<T>(List<T>)

Gets a System.Span<T> view over the data in a list. Items should not be added or removed from the System.Collections.Generic.List<T> while the System.Span<T> is in use.

DrawRectangleInset(Graphics, Color, int, RECT, bool)

Draws inset rectangle of specified pen color and width.

DrawRectangleInset(Graphics, Pen, RECT, bool)

Draws inset or outset rectangle.

FillRectangle(Graphics, Color, RECT)

Creates solid brush and calls System.Drawing.Graphics.FillRectangle.

GetOffsetAndLength(Range?, int)

If this is null, returns (0, length). Else calls System.Range.GetOffsetAndLength.

GetStartEnd(Range?, int)

If this is null, returns (0, length). Else calls System.Range.GetOffsetAndLength and returns start and end instead of start and length.

GetStartEnd(Range, int)

Calls System.Range.GetOffsetAndLength and returns start and end instead of start and length.

GetValue2(RegistryKey, string, string, object, RegistryValueOptions)

Gets a value from a subkey of this registry key.

HasAny<T>(T, T)

Returns true if this enum variable has one or more flag bits specified in flags.

Has<T>(T, T)

Returns true if this enum variable has all flag bits specified in flag.

Hwnd(Control, bool)

Gets window handle as wnd.

InsertAt<T>(T[], int, params ReadOnlySpan<T>)

Creates a copy of this array with several inserted elements.

InsertAt<T>(T[], int, T)

Creates a copy of this array with one inserted element.

IsAsciiAlpha(char)

Returns true if character is ASCII 'A' to 'Z' or 'a' to 'z'.

IsAsciiAlphaDigit(char)

Returns true if character is ASCII 'A' to 'Z' or 'a' to 'z' or '0' to '9'.

IsAsciiDigit(char)

Returns true if character is ASCII '0' to '9'.

IsNull<T>(ReadOnlySpan<T>)

Returns true if null pointer.

Ref<T>(List<T>, int)

Gets a reference to an item. List items must not be added or removed while it is in use.

RemoveAt<T>(T[], int, int)

Creates a copy of this array with one or more removed elements.

RemoveWhere<TKey, TValue>(Dictionary<TKey, TValue>, Func<KeyValuePair<TKey, TValue>, bool>)

Removes items based on a predicate. For example, all items that have certain value.

Resize(Bitmap, double, BRFilter, bool, bool)

Resizes this image.

Resize(Bitmap, int, int, BRFilter, bool, bool)

Resizes this image.

SetFlag<T>(ref T, T, bool)

Adds or removes a flag or flags.

ToInt(decimal)

Converts to int with rounding. Calls System.Convert.ToInt32.

ToInt(double)

Converts to int with rounding. Calls System.Convert.ToInt32.

ToInt(float)

Converts to int with rounding. Calls System.Convert.ToInt32.

ToS(decimal, string)

Converts decimal to string. Uses invariant culture, therefore decimal point is always '.', not ',' etc. Calls decimal.ToString.

ToS(double, string)

Converts double to string. Uses invariant culture, therefore decimal point is always '.', not ',' etc. Calls double.ToString.

ToS(int, string)

Converts int to string. Uses invariant culture, therefore minus sign is always ASCII '-', not '−' etc. Calls int.ToString.

ToS(long, string)

Converts long to string. Uses invariant culture, therefore minus sign is always ASCII '-', not '−' etc. Calls double.ToString.

ToS(nint, string)

Converts nint to string. Uses invariant culture, therefore minus sign is always ASCII '-', not '−' etc. Calls nint.ToString.

ToS(float, string)

Converts float to string. Uses invariant culture, therefore decimal point is always '.', not ',' etc. Calls float.ToString.

ToStringWithoutStack(Exception)

Returns string containing exception type name and message.