ExtensionMethods

Namespace: uMod

Assembly: uMod.Core.dll

Inheritance Object ExtensionMethods

Summary

Useful extension methods which are added to base types

Static Methods

Name

Summary

Add<T> (Enum, T)

Adds the specified flag to a bitwise enum

Basename (String, String)

Choice (String, Int32)

Pluralizes string from choice format using specified choice amount

Contains<T> (T[], T)

Dirname (String)

GetCustomAttribute<T> (Type, Boolean)

GetCustomAttribute<T> (MemberInfo, Boolean)

GetCustomAttributeIncludingBaseInterfaces<T> (Type)

GetCustomAttributes<T> (Type, Boolean)

GetCustomAttributes<T> (MemberInfo, Boolean)

GetCustomAttributesIncludingBaseInterfaces<T> (Type)

GetMethodsWithAttribute<T> (Type, BindingFlags)

GetNestedAbstractionsOfInterface<T> (Type, BindingFlags)

GetNestedInterfaces<T> (Type, BindingFlags)

GetNestedTypeDictionaryWithAttribute<T> (Type, BindingFlags)

GetNestedTypesOfInterface<T> (Type, BindingFlags)

GetNestedTypesOfInterface (Type, Type, BindingFlags)

GetNestedTypesWithAttribute<T> (Type, BindingFlags, Boolean)

GetParentTypes (Type, Boolean)

Has<T> (Enum, T)

Checks if a bitwise enum has the specified flag

Humanize (String)

ImplementsInterface (Type, Type)

Interpolate (String, String, Object)

Interpolates specified placeholder with the specified formattable value

Interpolate (String, ValueTuple[]<String, Object>)

Interpolate<T> (String, T, Int32)

Interpolates the specified object fields and properties

Is<T> (Enum, T)

Checks if a bitwise enum matches the specified flag exactly

IsAssignableFrom (Type, Type[])

Determine if any type is assignable

IsAssignableFrom<T1> (Type)

Determine if any type is assignable

IsAssignableFrom<T1,T2> (Type)

Determine if any type is assignable

IsAssignableFrom<T1,T2,T3> (Type)

Determine if any type is assignable

IsAssignableFrom<T1,T2,T3,T4> (Type)

Determine if any type is assignable

IsAssignableFrom<T1,T2,T3,T4,T5> (Type)

Determine if any type is assignable

IsAssignableFrom<T1,T2,T3,T4,T5,T6> (Type)

Determine if any type is assignable

IsAssignableFrom<T1,T2,T3,T4,T5,T6,T7> (Type)

Determine if any type is assignable

IsAssignableFrom<T1,T2,T3,T4,T5,T6,T7,T8> (Type)

Determine if any type is assignable

IsAssignableFrom<T1,T2,T3,T4,T5,T6,T7,T8,T9> (Type)

Determine if any type is assignable

IsAssignableFrom<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> (Type)

Determine if any type is assignable

IsDefault<T> (T)

Generic method to determine if struct value is default

IsSteamId (String)

IsSteamId (Object)

IsSteamId (UInt64)

NormalizePath (String)

Normalize directory seperator characters

Plaintext (String)

Converts a string to plain text

PopulateObject (IDictionary, Object)

Populate arbitrary object fields and properties with dictionary key value pairs

Quote (String)

Converts a string into a quote safe string

QuoteSafe (String)

Converts a string into a quote safe string

Remove<T> (Enum, T)

Removes the specified flag from a bitwise enum

Sample<T> (T[])

Sanitize (String)

Converts a string into a sanitized string for string.Format

SentenceCase (String)

TitleCase (String)

Titleize (String)

ToDataFormat (AuthDriver)

Convert AuthDriver to data format

ToHash (String, HashAlgorithm)

Convert string to hash

ToList (IList, Type)

Convert a list to list of specified type

ToObject (IDictionary, Type)

Convert dictionary to arbitrary object

ToSentence<T> (IEnumerable<T>)

Turns an array of strings into a sentence

ToType<T> (Object)

Convert specified object to generic type

ToType (Object, Type)

Convert specified object to specified type

Truncate (String, Int32)

Shortens a string to the length specified