KGySoft.CoreLibraries Namespace

The KGySoft.CoreLibraries namespace contains general library classes. Some of them are just additions to the standard .NET classes providing better performance, such as the generic EnumTEnum and FastRandom classes. Some others provide new functionality, such as the HiResTimer class. Additionally, contains extensions to numerous types including Enum, Type, Random, IEnumerableT and many other.

Classes

ArrayExtensions Provides extension methods for arrays.
ByteArrayExtensions Provides extension methods for the byte[] type.
CharExtensions Provides extension methods for the char type.
CollectionExtensions Provides extension methods for the ICollectionT type.
DateTimeExtensions Provides extension methods for the DateTime type.
DecimalExtensions Provides extension methods for the decimal type.
DelegateExtensions Provides extension methods for delegates.
DictionaryExtensions Provides extension methods for the IDictionaryTKey, TValue type.
DoubleExtensions Provides extension methods for the double type.
EnumTEnum Generic helper class for the Enum class. Provides high performance solutions for already existing functionality in the Enum class along with some additional features.
EnumComparerTEnum Provides an efficient IEqualityComparerT and IComparerT implementation for Enum types. Can be used for example in DictionaryTKey, TValue, SortedListTKey, TValue or CacheTKey, TValue instances with enum key, or as a comparer for List<T>.Sort(IComparer<T>) method to sort enum elements.
EnumerableExtensions Provides extension methods for the IEnumerableT type.
EnumExtensions Provides extension methods for the Enum type.
EventArgsT Represents a simple event argument of type T.
FastRandom Represents a pseudo random number generator, which is functionally compatible with the Random class but is significantly faster than that, especially when used with a specific seed. For cryptographically secure random numbers use the SecureRandom class instead.
Files Contains file-related methods.
FloatExtensions Provides extension methods for the float type.
GenerateObjectSettings Represents the settings for generating an object by the NextObject extension methods.
HiResTimer Represents a high resolution timer that allows precise timing even with sub-milliseconds intervals. The timer executes on a separated high priority thread.
HiResTimerElapsedEventArgs Provides data for the HiResTimer.Elapsed event.
ListExtensions Provides extension methods for the IListT type.
ObjectExtensions Provides extension methods for the Object type.
RandomExtensions Provides extension methods for the Random type.
SpanExtensions Provides extension methods for SpanT and ReadOnlySpanT types.
StreamExtensions Provides extension methods for the Stream type.
StringExtensions Provides extension methods for the string type.
StringSegmentComparer Represents a string comparison operation that uses specific case and culture-based or ordinal comparison rules allowing comparing strings by string, StringSegment and ReadOnlySpan<char> instances.
See the static properties for more details.
StringSegmentExtensions Provides extension methods for the StringSegment type.
ThreadSafeRandom Represents a thread-safe wrapper for random number generators. You can use the static Create methods to create a customized instance or just use the static Instance property for a fast shared instance (which uses FastRandom internally).
TypeExtensions Provides extension methods for the Type type.

Structures

RangeT Represents a range with lower and upper bounds.
StringSegment Represents a segment of a string. This type is similar to ReadOnlyMemory<char>/ReadOnlySpan<char> but StringSegment can be used on all platforms in the same way and is optimized for some dedicated string operations.
To create an instance use the AsSegment extension method overloads or just cast a string instance to StringSegment.
StringSegmentEnumerator Enumerates the characters of a StringSegment.
StringSegmentSplitOptions Specifies options for applicable StringSegment.Split method overloads, such as whether to omit empty substrings from the returned array or trim whitespace from segments.

Delegates

Conversion Represents a delegate for a type conversion. A conversion can be registered by the RegisterConversion extension method.
ConversionAttempt Represents a delegate for a type conversion attempt. A conversion can be registered by the RegisterConversion extension method.

Enumerations

EnumFormattingOptions Formatting options for the Enum<TEnum>.ToString(TEnum, EnumFormattingOptions, string) method.
FloatScale Represents the scaling strategy when generating random floating-point numbers.
ObjectInitialization Represents a strategy for initializing types when generating random objects.
StringCreation Represents a strategy for generating random strings.
TypeNameKind Represents name formatting options for the TypeExtensions.GetName methods.