-
Notifications
You must be signed in to change notification settings - Fork 0
DiGi.Core
public static class ConvertInheritance System.Object → Convert
Converts a System.Drawing.Color to a DiGi-compatible Color.
public static DiGi.Core.Classes.Color ToDiGi(this System.Drawing.Color color);color System.Drawing.Color
The source color to convert.
Color
A DiGi-compatible Color object.
Deserializes a byte array into a list of objects of type T.
public static System.Collections.Generic.List<T>? ToDiGi<T>(byte[]? bytes)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of elements in the list.
bytes System.Byte[]
The byte array to deserialize.
System.Collections.Generic.List<T>
A list of objects of type T, or null if deserialization fails.
Loads and deserializes a list of objects of type T from the specified path.
public static System.Collections.Generic.List<T>? ToDiGi<T>(DiGi.Core.Classes.Path path)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of elements in the list.
path Path
The path to the source data.
System.Collections.Generic.List<T>
A list of objects of type T, or null if loading fails.
Deserializes a JSON string into a list of objects of type T.
public static System.Collections.Generic.List<T>? ToDiGi<T>(string? json)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of elements in the list.
json System.String
The JSON string to deserialize.
System.Collections.Generic.List<T>
A list of objects of type T, or null if deserialization fails.
Converts an int color value (RGB) to a System.Drawing.Color with optional alpha.
public static System.Drawing.Color ToDrawing(int @int, byte alpha=byte.MaxValue);int System.Int32
The integer RGB color value.
alpha System.Byte
The alpha channel value.
System.Drawing.Color
The converted System.Drawing.Color.
Converts a color string (named, hex, or alpha hex) to a System.Drawing.Color.
public static System.Drawing.Color ToDrawing(string? value);value System.String
The color string to convert.
System.Drawing.Color
The converted System.Drawing.Color, or Color.Empty if parsing fails.
Converts a DiGi.Core.Classes.Color to a System.Drawing.Color.
public static System.Drawing.Color ToDrawing(this DiGi.Core.Classes.Color? color);color Color
The color to convert.
System.Drawing.Color
The converted System.Drawing.Color.
Converts a uint color value (ARGB) to a System.Drawing.Color.
public static System.Drawing.Color ToDrawing(uint @uint);uint System.UInt32
The unsigned integer ARGB color value.
System.Drawing.Color
The converted System.Drawing.Color.
Converts a serializable object to a JsonObject.
public static System.Text.Json.Nodes.JsonObject? ToJson(this DiGi.Core.Interfaces.ISerializableObject? serializableObject);serializableObject ISerializableObject
The serializable object to convert.
System.Text.Json.Nodes.JsonObject
A System.Text.Json.Nodes.JsonObject representation of the object, or null if the input is null.
Converts a collection of serializable objects to a JsonArray.
public static System.Text.Json.Nodes.JsonArray? ToJson<T>(this System.Collections.Generic.IEnumerable<T>? serializableObjects)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of elements in the collection.
serializableObjects System.Collections.Generic.IEnumerable<T>
The collection of serializable objects to convert.
System.Text.Json.Nodes.JsonArray
A System.Text.Json.Nodes.JsonArray containing the serialized objects, or null if the input is null.
Converts a range of values into a system list with a specified step.
public static System.Collections.Generic.List<T>? ToSystem<T>(this DiGi.Core.Classes.Range<T>? range, T step);T
The type of elements in the range.
range DiGi.Core.Classes.Range<T>
The range to convert.
step T
The step value used for conversion.
System.Collections.Generic.List<T>
A list containing the values from the range, or null if the range is null.
Converts a serializable object to its UTF-8 byte representation.
public static byte[]? ToSystem_Bytes(this DiGi.Core.Interfaces.ISerializableObject? serializableObject);serializableObject ISerializableObject
The serializable object to convert.
System.Byte[]
A byte array representing the UTF-8 encoded data, or null if the input is null.
Converts a collection of serializable objects to their UTF-8 byte representation.
public static byte[]? ToSystem_Bytes<T>(this System.Collections.Generic.IEnumerable<T>? serializableObjects)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of elements in the collection.
serializableObjects System.Collections.Generic.IEnumerable<T>
The collection of serializable objects to convert.
System.Byte[]
A byte array representing the UTF-8 encoded data, or null if the input is null.
Converts a collection of values into a dictionary where each key is associated with a list of values produced by the key function.
public static System.Collections.Generic.Dictionary<T,System.Collections.Generic.List<X>>? ToSystem_Dictionary<T,X>(this System.Collections.Generic.IEnumerable<X> values, System.Func<X,T?> keyFunc);T
The type of keys in the resulting dictionary.
X
The type of elements in the input collection.
values System.Collections.Generic.IEnumerable<X>
The collection of values to convert.
keyFunc System.Func<X,T>
A function to extract the key for each element.
System.Collections.Generic.Dictionary<T,System.Collections.Generic.List<X>>
A dictionary containing lists of values grouped by the keys produced by the key function, or null if the input is null.
Serializes a serializable object to a file and returns the FileInfo.
public static System.IO.FileInfo? ToSystem_FileInfo(this DiGi.Core.Interfaces.ISerializableObject? serializableObject, System.Nullable<DiGi.Core.Classes.Path> path);serializableObject ISerializableObject
The serializable object to serialize.
The destination path for the serialized file.
System.IO.FileInfo
A System.IO.FileInfo object representing the created file, or null if the operation failed.
Serializes a collection of serializable objects to a file and returns the FileInfo.
public static System.IO.FileInfo? ToSystem_FileInfo<T>(this System.Collections.Generic.IEnumerable<T>? serializableObjects, System.Nullable<DiGi.Core.Classes.Path> path)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of elements in the collection.
serializableObjects System.Collections.Generic.IEnumerable<T>
The collection of serializable objects to serialize.
The destination path for the serialized file.
System.IO.FileInfo
A System.IO.FileInfo object representing the created file, or null if the operation failed.
Formats a type reference and unique identifier into a system string.
public static string? ToSystem_String(this DiGi.Core.Classes.TypeReference? typeReference, string? uniqueId, string? format);typeReference TypeReference
The type reference to format.
uniqueId System.String
The unique identifier for the type.
format System.String
The format string to use.
System.String
The formatted system string, or null if applicable.
Converts a serializable object to its JSON string representation using default options.
public static string? ToSystem_String(this DiGi.Core.Interfaces.ISerializableObject? serializableObject);serializableObject ISerializableObject
The serializable object to convert.
System.String
A JSON string representation of the object, or null if the input is null.
Converts a serializable object to its JSON string representation using specified options.
public static string? ToSystem_String(this DiGi.Core.Interfaces.ISerializableObject? serializableObject, System.Text.Json.JsonSerializerOptions? jsonSerializerOptions);serializableObject ISerializableObject
The serializable object to convert.
jsonSerializerOptions System.Text.Json.JsonSerializerOptions
The options to use for JSON serialization.
System.String
A JSON string representation of the object, or null if applicable.
Converts a serializable reference to its system string representation with an optional source.
public static string? ToSystem_String(this DiGi.Core.Interfaces.ISerializableReference? serializableReference, string? source);serializableReference ISerializableReference
The serializable reference to convert.
source System.String
The optional source string.
System.String
The system string representation of the serializable reference, or null if applicable.
Converts a collection of serializable objects to a JSON string representation using default options.
public static string? ToSystem_String(this System.Collections.Generic.IEnumerable<DiGi.Core.Interfaces.ISerializableObject>? serializableObjects);serializableObjects System.Collections.Generic.IEnumerable<ISerializableObject>
The collection of serializable objects to convert.
System.String
A JSON string representation of the collection, or null if the input is null.
Converts a collection of serializable objects to a JSON string representation using specified options.
public static string? ToSystem_String(this System.Collections.Generic.IEnumerable<DiGi.Core.Interfaces.ISerializableObject>? serializableObjects, System.Text.Json.JsonSerializerOptions? jsonSerializerOptions);serializableObjects System.Collections.Generic.IEnumerable<ISerializableObject>
The collection of serializable objects to convert.
jsonSerializerOptions System.Text.Json.JsonSerializerOptions
The options to use for JSON serialization.
System.String
A JSON string representation of the collection, or null if applicable.
Converts a collection of objects implementing ISerializableObject to a JSON string representation using default options.
public static string? ToSystem_String<T>(this System.Collections.Generic.IEnumerable<T>? serializableObjects)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of elements in the collection.
serializableObjects System.Collections.Generic.IEnumerable<T>
The collection of serializable objects to convert.
System.String
A JSON string representation of the collection, or null if the input is null.
Convert.ToSystem_String<USerializableObject>(this IEnumerable<USerializableObject>, JsonSerializerOptions) Method
Converts a collection of objects implementing ISerializableObject to a JSON string representation using specified options.
public static string? ToSystem_String<USerializableObject>(this System.Collections.Generic.IEnumerable<USerializableObject>? serializableObjects, System.Text.Json.JsonSerializerOptions? jsonSerializerOptions)
where USerializableObject : DiGi.Core.Interfaces.ISerializableObject;USerializableObject
The type of the serializable objects in the collection.
serializableObjects System.Collections.Generic.IEnumerable<USerializableObject>
The collection of serializable objects to convert.
jsonSerializerOptions System.Text.Json.JsonSerializerOptions
The options to use for JSON serialization.
System.String
A JSON string representation of the collection, or null if applicable.
public static class CreateInheritance System.Object → Create
Creates a 2D array of values by reading and parsing a delimited text file.
public static T?[,]? Array<T>(string? path, string separator="\t", bool removeEmptyLines=true, T? @default=default(T?));T
The type of the array elements.
path System.String
The file path to read from.
separator System.String
The string used to separate values in each line.
removeEmptyLines System.Boolean
If true, ignores empty lines in the file.
default T
The default value to use if parsing fails.
T[]
A 2D array containing the parsed values, or null if the file is invalid.
Creates a hierarchical structure of Category objects from an enumerable sequence of names.
public static DiGi.Core.Classes.Category? Category(this System.Collections.Generic.IEnumerable<string>? names);names System.Collections.Generic.IEnumerable<System.String>
The sequence of names representing the category hierarchy.
Category
The root Category object, or null if the input is empty.
Creates a CategoryPath object by parsing a string containing quoted names.
public static DiGi.Core.Classes.CategoryPath? CategoryPath(string text);text System.String
The string containing the category path.
CategoryPath
A CategoryPath object, or null if the string is invalid or empty.
Creates a ConfigurationFile object by loading it from the specified path.
public static DiGi.Core.Classes.ConfigurationFile? ConfigurationFile(string? path);path System.String
The file path to the configuration file.
ConfigurationFile
A ConfigurationFile object loaded with data, or null if the file does not exist.
Creates a dictionary instance with the specified key and value types.
public static System.Collections.IDictionary? Dictionary(System.Type? key, System.Type? value);key System.Type
The type of keys in the dictionary.
value System.Type
The type of values in the dictionary.
System.Collections.IDictionary
An System.Collections.IDictionary instance created with the specified types, or null.
Creates the directory and its parent directories if they do not exist.
public static bool Directory(string? directory);directory System.String
The path to the directory to create.
System.Boolean
True if the directory was created or already exists; otherwise, false.
Creates a unique GUID that is consistent for the same string
public static System.Guid Guid(this string? @string);string System.String
System.Guid
Unique Guid
Creates a unique GUID for the specified type that does not exist in the given cluster.
public static System.Guid Guid<TUniqueObject>(this DiGi.Core.Classes.UniqueObjectValueCluster<TUniqueObject>? uniqueObjectValueCluster, System.Type? type)
where TUniqueObject : DiGi.Core.Interfaces.IUniqueObject;TUniqueObject
The type of the unique object value.
uniqueObjectValueCluster DiGi.Core.Classes.UniqueObjectValueCluster<TUniqueObject>
The cluster used to ensure the generated GUID is unique.
type System.Type
The type for which the unique GUID is created.
System.Guid
A unique Guid(this string) that does not exist in the specified cluster.
Creates a GUID reference for the specified object using the given function to retrieve its GUID.
public static DiGi.Core.Classes.GuidReference? GuidReference<T>(this T? @object, System.Func<T?,System.Guid> func);T
The type of the object.
object T
The object for which to create a GUID reference.
func System.Func<T,System.Guid>
The function used to retrieve the GUID from the object.
GuidReference
A GuidReference if successful; otherwise, null.
Creates a unique GUID reference for the specified type that does not exist in the given cluster.
public static DiGi.Core.Classes.GuidReference? GuidReference<TUniqueObject>(this DiGi.Core.Classes.UniqueObjectValueCluster<TUniqueObject>? uniqueObjectValueCluster, System.Type? type)
where TUniqueObject : DiGi.Core.Interfaces.IUniqueObject;TUniqueObject
The type of the unique object.
uniqueObjectValueCluster DiGi.Core.Classes.UniqueObjectValueCluster<TUniqueObject>
The cluster to check for existing references.
type System.Type
The type for which to create a GUID reference.
GuidReference
A GuidReference if successful; otherwise, null.
Creates a JSON node from the given object.
public static System.Text.Json.Nodes.JsonNode? JsonNode(this object? @object);object System.Object
The object to convert to a JSON node.
System.Text.Json.Nodes.JsonNode
A JsonNode(this object) representing the object, or null if the object is null.
Creates a list instance of the specified type.
public static System.Collections.IList? List(System.Type? type);type System.Type
The type of elements in the list.
System.Collections.IList
A new System.Collections.IList instance, or null if the operation fails.
Creates a wrapper for a long-based progress reporter.
public static DiGi.Core.Classes.LongProgressWrapper? LongProgressWrapper(this System.IProgress<long>? progress, long initialValue=0L);progress System.IProgress<System.Int64>
The progress reporter to wrap.
initialValue System.Int64
The initial value for the progress reporter.
LongProgressWrapper
A LongProgressWrapper(this IProgress<long>, long) instance, or null if the provided progress is null.
Creates a memory stream from the given string.
public static System.IO.MemoryStream? MemoryStream(this string? text);text System.String
The string to convert into a memory stream.
System.IO.MemoryStream
A System.IO.MemoryStream containing the text, or null if the input is null.
Creates a memory stream from the given collection of strings.
public static System.IO.MemoryStream? MemoryStream(this System.Collections.Generic.IEnumerable<string>? text);text System.Collections.Generic.IEnumerable<System.String>
The collection of strings to convert into a memory stream.
System.IO.MemoryStream
A System.IO.MemoryStream containing the text, or null if the input is null.
Creates an instance of the specified type using the provided arguments.
public static T? Object<T>(params object[] objects);T
The type of the object to create.
objects System.Object[]
The arguments to be passed to the constructor of the created object.
T
An instance of type T, or null if the operation fails.
Creates an object path from the given text.
public static DiGi.Core.Classes.ObjectPath? ObjectPath(string? text);text System.String
The text to be converted into an object path.
ObjectPath
An ObjectPath(string) if successful; otherwise, null.
Creates parallel options based on the specified processor fraction.
public static System.Threading.Tasks.ParallelOptions ParallelOptions(double fraction=0.9);fraction System.Double
The fraction of available processors to be used for parallel operations.
System.Threading.Tasks.ParallelOptions
A ParallelOptions(double) instance configured with the specified fraction.
Creates a random number generator with an optional seed.
public static System.Random Random(int seed=-1);seed System.Int32
The seed value for the random number generator. Defaults to -1.
System.Random
A new Random(int) instance.
Creates a serializable object from the given JSON object.
public static T? SerializableObject<T>(this System.Text.Json.Nodes.JsonObject? jsonObject)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of the object to create.
jsonObject System.Text.Json.Nodes.JsonObject
The JSON object to convert into a serializable object.
T
A serializable object of type T, or null if the conversion fails.
Creates a list of serializable objects from the given JSON array.
public static System.Collections.Generic.List<T>? SerializableObjects<T>(this System.Text.Json.Nodes.JsonArray? jsonArray)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of elements in the resulting list.
jsonArray System.Text.Json.Nodes.JsonArray
The JSON array to be converted into a list of serializable objects.
System.Collections.Generic.List<T>
A list containing the deserialized objects of type T, or null if the input is null.
Creates a serialization constructor for the specified type.
public static DiGi.Core.Classes.SerializationConstructor? SerializationConstructor(this System.Type? type);type System.Type
The type for which to create the serialization constructor.
SerializationConstructor
A SerializationConstructor(this Type) if successful; otherwise, null.
Creates a serialization method collection for the specified type.
public static DiGi.Core.Classes.SerializationMethodCollection? SerializationMethodCollection(this System.Type? type);type System.Type
The type for which to create the serialization method collection.
SerializationMethodCollection
A SerializationMethodCollection(this Type) containing the serialization methods for the specified type, or null if none are found.
Creates a type reference for the specified type.
public static DiGi.Core.Classes.TypeReference? TypeReference(this System.Type? type);type System.Type
The type for which to create a type reference.
TypeReference
A type reference for the specified type, or null if the provided type is null.
Creates a unique reference for the specified object.
public static DiGi.Core.Classes.UniqueReference? UniqueReference(this object? @object);object System.Object
The object for which to create a unique reference.
UniqueReference
A unique reference for the specified object.
Creates a UTC offset from the given double value.
public static DiGi.Core.Enums.UTC UTC(double timeOffset);timeOffset System.Double
The double representation of the UTC offset.
UTC
A UTC instance representing the specified offset.
Creates a UTC offset from the given float value.
public static DiGi.Core.Enums.UTC UTC(float timeOffset);timeOffset System.Single
The float representation of the UTC offset.
UTC
A UTC instance representing the specified offset.
Creates a UTC offset from the given string value.
public static DiGi.Core.Enums.UTC UTC(string value);value System.String
The string representation of the UTC offset.
UTC
A UTC instance representing the specified offset.
public static class ModifyInheritance System.Object → Modify
Adds item to the list if condition in func is not meet by any of item on the list
public static bool Add<T>(this System.Collections.Generic.List<T>? list, T item, System.Func<T,bool> func);T
Item type
list System.Collections.Generic.List<T>
List
item T
Item to be added
func System.Func<T,System.Boolean>
Condition
System.Boolean
True if item has been added
Appends the full, formatted type name of a Type to the StringBuilder.
public static void Append(this System.Text.StringBuilder? stringBuilder, System.Type? type);stringBuilder System.Text.StringBuilder
The StringBuilder to append to.
type System.Type
The Type to format and append.
Extends list to given length (count) by adding values from start of the list
public static bool Extend<T>(this System.Collections.Generic.List<T>? list, int count);T
List type
list System.Collections.Generic.List<T>
List
count System.Int32
New length of the list
System.Boolean
True if new items added. False if list is longer than given count value, list is empty or null
Populates an ISerializableObject from a JSON object.
public static bool FromJsonObject(this DiGi.Core.Interfaces.ISerializableObject? serializableObject, System.Text.Json.Nodes.JsonObject? jsonObject);serializableObject ISerializableObject
The serializable object to populate.
jsonObject System.Text.Json.Nodes.JsonObject
The JSON object containing the data.
System.Boolean
True if the object was successfully populated; otherwise, false.
Matches the length of two lists by duplicating elements cyclically from the shorter list to match the longer list.
public static bool MatchLength<T,X>(System.Collections.Generic.List<T>? list_1, System.Collections.Generic.List<X>? list_2);T
The type of elements in the first list.
X
The type of elements in the second list.
list_1 System.Collections.Generic.List<T>
The first list.
list_2 System.Collections.Generic.List<X>
The second list.
System.Boolean
True if lengths were successfully matched; otherwise, false.
Releases all references to a COM object.
public static bool ReleaseCOMObject(this object? cOMObject);cOMObject System.Object
The COM object to release.
System.Boolean
True if the object was successfully released; otherwise, false.
Sorts the elements of a list using a specified function to extract a comparable key.
public static void Sort<T>(this System.Collections.Generic.List<T>? list, System.Func<T,System.IComparable>? func);T
The type of elements in the list.
list System.Collections.Generic.List<T>
The list to sort.
func System.Func<T,System.IComparable>
A function to extract the comparable key from an element.
Provides utility methods for querying and determining data types of objects and types.
public static class QueryInheritance System.Object → Query
Determines whether two double values are approximately equal within a specified tolerance.
public static bool AlmostEquals(this double value_1, double value_2, double tolerance=1E-06);value_1 System.Double
The first value to compare.
value_2 System.Double
The second value to compare.
tolerance System.Double
The maximum allowed difference between the values.
System.Boolean
True if the values are approximately equal; otherwise, false.
Calculates the aspect ratio of two values.
public static double AspectRatio(this double value_1, double value_2, bool normalized=false);value_1 System.Double
The first value.
value_2 System.Double
The second value.
normalized System.Boolean
If true, returns the ratio of the smaller value to the larger value.
System.Double
The calculated aspect ratio, or NaN if inputs are invalid.
Maps an out-of-bounds index back into the specified range using a wrap-around (circular) logic. If the index is within the range, it returns the index unchanged. If the range is null, returns System.Int32.MinValue.
public static int BoundedIndex(this DiGi.Core.Classes.Range<int>? range, int index);range DiGi.Core.Classes.Range<System.Int32>
The boundaries within which the index should be contained.
index System.Int32
The index to be evaluated or mapped.
System.Int32
The original index if it's within bounds;
the wrapped index if it's outside;
or System.Int32.MinValue if the range is null.
Bounded index between 0 and count - 1
public static int BoundedIndex(this int count, int index);count System.Int32
Items count
index System.Int32
Index
System.Int32
BoundedIndex
Computes the MD5 checksum of a string.
public static string? Checksum(this string? value);value System.String
The string to compute the checksum for.
System.String
A string representing the MD5 checksum, or null if the input is null.
Limits the values of a Range to be within the specified minimum and maximum values.
public static DiGi.Core.Classes.Range<T>? Clamp<T>(this DiGi.Core.Classes.Range<T>? range, T min, T max);T
The type of the range elements.
range DiGi.Core.Classes.Range<T>
The range to clamp.
min T
The minimal value.
max T
The maximal value.
DiGi.Core.Classes.Range<T>
A new Range clamped to the specified limits, or null if the input range is null.
Limits given value to min and max
public static T Clamp<T>(this T value, T min, T max);T
The type of the values being clamped.
value T
Value to be clamped
min T
Minimal Value
max T
Maximal Value
T
Clamp value
Clones a sequence of serializable objects into a new list.
public static System.Collections.Generic.List<T?>? Clone<T>(this System.Collections.Generic.IEnumerable<T?>? serializableObjects)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of the serializable objects.
serializableObjects System.Collections.Generic.IEnumerable<T>
The sequence of objects to clone.
System.Collections.Generic.List<T>
A new list containing the cloned objects, or null if the input is null.
Clones an array into a new array.
public static T?[]? Clone<T>(this T?[]? values);T
The type of the array elements.
The array to clone.
T[]
A new array containing the cloned elements, or null if the input is null.
Creates a clone of a serializable object.
public static TSerializableObject? Clone<TSerializableObject>(this TSerializableObject? serializableObject)
where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;TSerializableObject
The type of the serializable object.
serializableObject TSerializableObject
The object to clone.
TSerializableObject
A cloned instance of the object, or default if cloning fails.
Clones a sequence of serializable objects and filters out any null results.
public static System.Collections.Generic.List<T>? CloneAndFilterNulls<T>(this System.Collections.Generic.IEnumerable<T?>? serializableObjects)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of the serializable objects.
serializableObjects System.Collections.Generic.IEnumerable<T>
The sequence of objects to clone.
System.Collections.Generic.List<T>
A list of non-null cloned objects, or null if the input is null.
Compares two numbers using NumberComparisonType (Example: NumberComparisonType.Greater returns true if value_1 greater than value_2)
public static bool Compare(this double value_1, double value_2, DiGi.Core.Enums.NumberComparisonType numberComparisonType);value_1 System.Double
First value
value_2 System.Double
Second value
numberComparisonType NumberComparisonType
Number Comparison Type example Equals etc.
System.Boolean
Comparison Type Result
Compares two numbers using NumberComparisonType (Example: NumberComparisonType.Greater returns true if value_1 greater than value_2)
public static bool Compare(this double value_1, double value_2, DiGi.Core.Enums.NumberComparisonType numberComparisonType, double tolerance);value_1 System.Double
First value
value_2 System.Double
Second value
numberComparisonType NumberComparisonType
Number Comparison Type example Equals etc.
tolerance System.Double
Comparison tolerance
System.Boolean
Comparison Type Result
Compares two numbers using TextComparisonType (Example: TextComparisonType.StartsWith returns true if value_1 starts with value_2)
public static bool Compare(this string? value_1, string? value_2, DiGi.Core.Enums.TextComparisonType textComparisonType, bool caseSensitive=true);value_1 System.String
Base value to be checked, reference text ie.GUID to be found
value_2 System.String
Text to be checked ie. name containing GUID
textComparisonType TextComparisonType
Text Comparison Type
caseSensitive System.Boolean
Case Sensitive
System.Boolean
Bool
Compares a collection of doubles against a single double using the specified comparison type.
public static System.Collections.Generic.List<bool>? Compare(this System.Collections.Generic.IEnumerable<double>? values, double value, DiGi.Core.Enums.NumberComparisonType numberComparisonType);values System.Collections.Generic.IEnumerable<System.Double>
The collection of doubles to compare.
value System.Double
The double to compare against.
numberComparisonType NumberComparisonType
The numeric comparison type to use.
System.Collections.Generic.List<System.Boolean>
A list of booleans representing the comparison results.
Compares a collection of strings against a single string using the specified comparison type.
public static System.Collections.Generic.List<bool>? Compare(this System.Collections.Generic.IEnumerable<string>? values, string? value, DiGi.Core.Enums.TextComparisonType textComparisonType, bool caseSensitive=true);values System.Collections.Generic.IEnumerable<System.String>
The collection of strings to compare.
value System.String
The string to compare against.
textComparisonType TextComparisonType
The comparison type to use.
caseSensitive System.Boolean
Whether the comparison should be case sensitive.
System.Collections.Generic.List<System.Boolean>
A list of booleans representing the comparison results.
Compares two DateTimes using NumberComparisonType (Example: NumberComparisonType.Greater returns true if value_1 greater than value_2)
public static bool Compare(this System.DateTime value_1, System.DateTime value_2, DiGi.Core.Enums.NumberComparisonType numberComparisonType);value_1 System.DateTime
First value
value_2 System.DateTime
Second value
numberComparisonType NumberComparisonType
Number Comparison Type example Equals etc.
System.Boolean
Comparison Type Result
Compresses an ISerializableObject into a Base64 encoded string.
public static string? Compress(this DiGi.Core.Interfaces.ISerializableObject? serializableObject);serializableObject ISerializableObject
The object to compress.
System.String
A compressed string, or null if the object is null.
Source: https://stackoverflow\.com/questions/7343465/compression\-decompression\-string\-with\-c\-sharp
public static string? Compress(this string? @string);string System.String
String to be compressed
System.String
Compressed string
Compresses a collection of ISerializableObject into a Base64 encoded string.
public static string? Compress<T>(this System.Collections.Generic.IEnumerable<T>? serializableObject)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of the serializable objects.
serializableObject System.Collections.Generic.IEnumerable<T>
The collection of objects to compress.
System.String
A compressed string, or null if the collection is null.
Optimized retrieval of a custom attribute from an Enum value.
public static TAttribute? CustomAttribute<TAttribute>(System.Enum? @enum)
where TAttribute : System.Attribute;TAttribute
The type of the attribute to retrieve.
enum System.Enum
The enum value to search for the attribute.
TAttribute
The specified attribute if found; otherwise, null.
Optimized retrieval of a custom attribute from a Type and member name.
public static TAttribute? CustomAttribute<TAttribute>(System.Type? type, string? text)
where TAttribute : System.Attribute;TAttribute
The type of the attribute to retrieve.
type System.Type
The type containing the member.
text System.String
The name of the member from which to retrieve the attribute.
TAttribute
The specified attribute if found; otherwise, null.
Efficiently retrieves a custom attribute from MemberInfo using generic reflection extensions.
public static TAttribute? CustomAttribute<TAttribute>(this System.Reflection.MemberInfo? memberInfo)
where TAttribute : System.Attribute;TAttribute
The type of the attribute to retrieve.
memberInfo System.Reflection.MemberInfo
The member information to search for the attribute.
TAttribute
The specified attribute if found; otherwise, null.
Retrieves an attribute from the Type level (e.g., for CategoryAttribute on Enum declaration).
public static TAttribute? CustomTypeAttribute<TAttribute>(System.Type? type)
where TAttribute : System.Attribute;TAttribute
The type of the attribute to retrieve.
type System.Type
The type from which to retrieve the attribute.
TAttribute
The specified attribute if found; otherwise, null.
Gets the DiGi.Core.Enums.DataType of the specified object.
public static DiGi.Core.Enums.DataType DataType(this object? @object);object System.Object
The object for which to get the data type.
DataType
The DiGi.Core.Enums.DataType of the specified object.
Gets the DiGi.Core.Enums.DataType of the specified object and determines if it is nullable.
public static DiGi.Core.Enums.DataType DataType(this object? @object, out bool nullable);object System.Object
The object for which to get the data type.
nullable System.Boolean
When this method returns, contains a boolean value indicating whether the type is nullable.
DataType
The DiGi.Core.Enums.DataType of the specified object.
Gets the DiGi.Core.Enums.DataType of the specified type.
public static DiGi.Core.Enums.DataType DataType(this System.Type? type);type System.Type
The type for which to get the data type.
DataType
The DiGi.Core.Enums.DataType of the specified type.
Gets the DiGi.Core.Enums.DataType of the specified type and determines if it is nullable.
public static DiGi.Core.Enums.DataType DataType(this System.Type? type, out bool nullable);type System.Type
The type for which to get the data type.
nullable System.Boolean
When this method returns, contains a boolean value indicating whether the type is nullable.
DataType
The DiGi.Core.Enums.DataType of the specified type.
Counts the number of decimal places in a double value.
public static int DecimalPlacesCount(this double value);value System.Double
The value to evaluate.
System.Int32
The number of decimal places.
Source: https://stackoverflow\.com/questions/7343465/compression\-decompression\-string\-with\-c\-sharp
public static string? Decompress(this string? @string);string System.String
Compressed string to be decompressed
System.String
Decompressed string
Decompresses a Base64 encoded string back into a collection of ISerializableObjects.
public static System.Collections.Generic.List<T>? Decompress<T>(this string? @string)
where T : DiGi.Core.Interfaces.ISerializableObject;T
The type of the serializable objects.
string System.String
The string to decompress.
System.Collections.Generic.List<T>
A list of deserialized objects, or null if decompression fails.
Returns the default value for a given Type.
public static object? Default(this System.Type? type);type System.Type
The type to get the default value for.
System.Object
The default value, or null for reference types.
Gets the description attribute of an enum value.
public static string? Description(this System.Enum? @enum);enum System.Enum
The enum value.
System.String
The description string, or the enum name if no attribute is found.
Gets the description attribute of a Type.
public static string? Description(this System.Type? type);type System.Type
The type.
System.String
The description string, or the type name if no attribute is found.
Retrieves a list of all parent directories up to the root for a given directory path.
public static System.Collections.Generic.List<string>? Directories(string? directory);directory System.String
The starting directory path.
System.Collections.Generic.List<System.String>
A list of directory paths, or null if the path is invalid.
Retrieves a list of all parent directories up to the root for a given DirectoryInfo.
public static System.Collections.Generic.List<string>? Directories(System.IO.DirectoryInfo? directoryInfo);directoryInfo System.IO.DirectoryInfo
The DirectoryInfo object.
System.Collections.Generic.List<System.String>
A list of directory paths, or null if the DirectoryInfo is null.
Creates a duplicate of an IGuidObject, optionally assigning it a new Guid.
public static TGuidObject? Duplicate<TGuidObject>(this TGuidObject? guidObject, System.Nullable<System.Guid> guid=null)
where TGuidObject : DiGi.Core.Interfaces.IGuidObject;TGuidObject
The type of the GUID object.
guidObject TGuidObject
The object to duplicate.
guid System.Nullable<System.Guid>
The optional new GUID to assign to the duplicate.
TGuidObject
A duplicated object, or default if the duplication fails.
Parses a string into an Enum value of the specified type.
public static System.Enum? Enum(string? text, System.Type? type);text System.String
The string representation of the Enum.
type System.Type
The Type of the Enum.
System.Enum
The parsed Enum value, or null if parsing fails.
Parses a string into a strongly-typed Enum value.
public static TEnum? Enum<TEnum>(string? text)
where TEnum : System.Enum;TEnum
The type of the Enum.
text System.String
The string representation of the Enum.
TEnum
The parsed Enum value, or the 'Undefined' enum value if found, or default if parsing fails.
Parses a string into a strongly-typed Enum value, providing a fallback default value.
public static TEnum? Enum<TEnum>(string? text, TEnum? @default)
where TEnum : System.Enum;TEnum
The type of the Enum.
text System.String
The string representation of the Enum.
default TEnum
The default value to return if parsing fails.
TEnum
The parsed Enum value, or the default if parsing fails.
Compares two byte arrays for equality.
public static bool Equals(this byte[]? bytes_1, byte[]? bytes_2);bytes_1 System.Byte[]
The first byte array.
bytes_2 System.Byte[]
The second byte array.
System.Boolean
True if the arrays are equal; otherwise, false.
Compares two non-generic IEnumerable collections for equality.
public static bool Equals(this System.Collections.IEnumerable? enumerable_1, System.Collections.IEnumerable? enumerable_2);enumerable_1 System.Collections.IEnumerable
The first collection.
enumerable_2 System.Collections.IEnumerable
The second collection.
System.Boolean
True if the collections contain the same elements in the same order; otherwise, false.
Compares two generic IEnumerable collections for equality.
public static bool Equals<T>(this System.Collections.Generic.IEnumerable<T>? enumerable_1, System.Collections.Generic.IEnumerable<T>? enumerable_2);T
The type of the elements in the collections.
enumerable_1 System.Collections.Generic.IEnumerable<T>
The first collection.
enumerable_2 System.Collections.Generic.IEnumerable<T>
The second collection.
System.Boolean
True if the collections contain the same elements in the same order; otherwise, false.
Retrieves all public static extension methods from the current app domain assemblies.
public static System.Collections.Generic.List<System.Reflection.MethodInfo> ExtensionMethodInfos(System.Type? type=null);type System.Type
Optional. The type that the extension method extends.
System.Collections.Generic.List<System.Reflection.MethodInfo>
A list of MethodInfo objects representing the extension methods.
Filters a sequence of values based on a predicate, splitting them into matching and non-matching lists.
public static bool Filter<T>(this System.Collections.Generic.IEnumerable<T>? values, System.Func<T?,bool> func, out System.Collections.Generic.List<T>? values_In, out System.Collections.Generic.List<T>? values_Out);T
The type of elements in the sequence.
values System.Collections.Generic.IEnumerable<T>
The sequence to filter.
func System.Func<T,System.Boolean>
The predicate function to test each element.
values_In System.Collections.Generic.List<T>
When this method returns, contains the elements that satisfied the condition.
values_Out System.Collections.Generic.List<T>
When this method returns, contains the elements that did not satisfy the condition.
System.Boolean
True if the filtering was successful; otherwise, false.
Filters out null values from a sequence of items.
public static System.Collections.Generic.List<T>? FilterNulls<T>(this System.Collections.Generic.IEnumerable<T?>? values);T
The type of the elements.
values System.Collections.Generic.IEnumerable<T>
The sequence to filter.
System.Collections.Generic.List<T>
A list containing only the non-null elements, or null if the input is null.
Finds the first element in a sequence that satisfies a specified condition.
public static T? Find<T>(this System.Collections.Generic.IEnumerable<T?>? values, System.Func<T?,bool> func);T
The type of the elements.
values System.Collections.Generic.IEnumerable<T>
The sequence to search.
func System.Func<T,System.Boolean>
The predicate function.
T
The first element that matches the condition, or default if not found.
Flattens a nested JSON array into a single-dimensional JSON array.
public static System.Text.Json.Nodes.JsonArray? Flatten(this System.Text.Json.Nodes.JsonArray? jsonArray);jsonArray System.Text.Json.Nodes.JsonArray
The JSON array to flatten.
System.Text.Json.Nodes.JsonArray
A new flattened JSON array, or null if the input is null.
Gets the full name of an enum value, including its full type name.
public static string? FullName(this System.Enum? @enum);enum System.Enum
The enum value.
System.String
The formatted full name string, or null if the input is null.
Retrieves the full type name of an ISerializableObject.
public static string? FullTypeName(DiGi.Core.Interfaces.ISerializableObject? serializableObject);serializableObject ISerializableObject
The serializable object.
System.String
The full type name.
Retrieves the full, formatted type name of a Type.
public static string? FullTypeName(System.Type? type);type System.Type
The type.
System.String
The full type name.
Retrieves the full type name from a JsonObject.
public static string? FullTypeName(this System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object.
System.String
The full type name, or null if not found.
Computes a hash code from an array of integers.
public static int HashCode(params int[]? values);values System.Int32[]
The values to hash.
System.Int32
The computed hash code.
Determines whether the specified type is nullable.
public static bool IsNullable(this System.Type type);type System.Type
The type to check.
System.Boolean
True if the type is nullable; otherwise, false.
Determines whether the specified DataType represents a numeric type.
public static bool IsNumeric(this DiGi.Core.Enums.DataType dataType);dataType DataType
The DataType to check.
System.Boolean
True if the DataType is numeric; otherwise, false.
Determines whether the specified DataType represents a numeric type and checks if it's an integer.
public static bool IsNumeric(this DiGi.Core.Enums.DataType dataType, out bool isInteger);dataType DataType
The DataType to check.
isInteger System.Boolean
Out parameter indicating whether the numeric type is an integer.
System.Boolean
True if the DataType is numeric; otherwise, false.
Determines whether the specified object represents a numeric type.
public static bool IsNumeric(this object? @object);object System.Object
The object to check.
System.Boolean
True if the object is numeric; otherwise, false.
Determines whether the specified object represents a numeric type and checks if it's an integer.
public static bool IsNumeric(this object? @object, out bool isInteger);object System.Object
The object to check.
isInteger System.Boolean
Out parameter indicating whether the numeric type is an integer.
System.Boolean
True if the object is numeric; otherwise, false.
Determines whether the specified Type represents a numeric type.
public static bool IsNumeric(this System.Type? type);type System.Type
The type to check.
System.Boolean
True if the type is numeric; otherwise, false.
Determines whether the specified Type represents a numeric type and checks if it's an integer.
public static bool IsNumeric(this System.Type? type, out bool isInteger);type System.Type
The type to check.
isInteger System.Boolean
Out parameter indicating whether the numeric type is an integer.
System.Boolean
True if the type is numeric; otherwise, false.
Determines the JsonValueKind of a given object.
public static System.Text.Json.JsonValueKind JsonValueKind(this object value);value System.Object
The object to evaluate.
System.Text.Json.JsonValueKind
The corresponding JsonValueKind.
Linearly interpolates between color_1 and color_2 by value Source: http://www\.java2s\.com/example/csharp/system\.drawing/lerp\-between\-two\-color\.html
public static System.Drawing.Color Lerp(this System.Drawing.Color color_1, System.Drawing.Color color_2, double value);color_1 System.Drawing.Color
Start Color
color_2 System.Drawing.Color
End Color
value System.Double
Lerp value (0-1)
System.Drawing.Color
Lerp Color
Creates list of colors being linearly interpolated between color_1 and color_2 by value
public static System.Collections.Generic.List<System.Drawing.Color>? Lerps(this System.Drawing.Color color_1, System.Drawing.Color color_2, int count);color_1 System.Drawing.Color
Start Color
color_2 System.Drawing.Color
End Color
count System.Int32
Number of colors
System.Collections.Generic.List<System.Drawing.Color>
Lerped Colors
Calculates the next index in a circular collection.
public static int Next(this int count, int index);count System.Int32
The total number of elements.
index System.Int32
The current index.
System.Int32
The next index, or -1 if invalid.
Gets the next element in a sequence, wrapping around if necessary.
public static T? Next<T>(this System.Collections.Generic.IEnumerable<T?>? values, int index);T
The type of elements in the sequence.
values System.Collections.Generic.IEnumerable<T>
The sequence to search.
index System.Int32
The current index.
T
The next element, or default if the sequence is null or empty.
Gets the next value in an enum, wrapping around to the first if it's the last.
public static TEnum? Next<TEnum>(TEnum? @enum)
where TEnum : System.Enum;TEnum
The enum type.
enum TEnum
The current enum value.
TEnum
The next enum value.
Gets the opposite of the specified NumberComparisonType.
public static DiGi.Core.Enums.NumberComparisonType Opposite(this DiGi.Core.Enums.NumberComparisonType numberComparisonType);numberComparisonType NumberComparisonType
The number comparison type.
NumberComparisonType
The opposite NumberComparisonType.
Gets the opposite of the specified TextComparisonType.
public static DiGi.Core.Enums.TextComparisonType Opposite(this DiGi.Core.Enums.TextComparisonType textComparisonType);textComparisonType TextComparisonType
The text comparison type.
TextComparisonType
The opposite TextComparisonType.
Calculates the previous index in a circular collection.
public static int Previous(this int count, int index);count System.Int32
The total number of elements.
index System.Int32
The current index.
System.Int32
The previous index, or -1 if invalid.
Gets the previous element in a sequence, wrapping around if necessary.
public static T? Previous<T>(this System.Collections.Generic.IEnumerable<T?>? values, int index);T
The type of elements in the sequence.
values System.Collections.Generic.IEnumerable<T>
The sequence to search.
index System.Int32
The current index.
T
The previous element, or default if the sequence is null or empty.
Gets the previous value in an enum, wrapping around to the last if it's the first.
public static TENum? Previous<TENum>(TENum? @enum)
where TENum : System.Enum;TENum
The enum type.
enum TENum
The current enum value.
TENum
The previous enum value.
Gets the calculated processor count based on a specified fraction.
public static int ProcessorCount(double fraction=1.0);fraction System.Double
The fraction of total processors to use.
System.Int32
The calculated number of processors.
Splits a string by a separator, respecting quoted sections.
public static System.Collections.Generic.List<string>? QuotedStrings(string? text, string separator=",");text System.String
The text to split.
separator System.String
The separator string.
System.Collections.Generic.List<System.String>
A list of extracted strings.
Generates a random double within a Range struct using a seed.
public static double Random(DiGi.Core.Classes.Range<double>? range, int seed=-1, double tolerance=0.001);range DiGi.Core.Classes.Range<System.Double>
The range.
seed System.Int32
The seed.
tolerance System.Double
The tolerance.
System.Double
A random double.
Generates a random integer within a Range struct using a seed.
public static int Random(DiGi.Core.Classes.Range<int>? range, int seed=-1);range DiGi.Core.Classes.Range<System.Int32>
The range.
seed System.Int32
The seed.
System.Int32
A random integer.
Generates a random double using a seed.
public static double Random(double start, double end, int seed=-1, double tolerance=0.001);start System.Double
The start value.
end System.Double
The end value.
seed System.Int32
The seed.
tolerance System.Double
The tolerance.
System.Double
A random double.
Generates a random boolean using a seed.
public static bool Random(int seed=-1);seed System.Int32
The seed.
System.Boolean
A random boolean.
Generates a random integer within a range using a seed.
public static int Random(int start, int end, int seed=-1);start System.Int32
The start value.
end System.Int32
The end value.
seed System.Int32
The seed.
System.Int32
A random integer.
Generates a random boolean.
public static bool Random(System.Random? random);random System.Random
The Random instance.
System.Boolean
A random boolean.
Generates a random double within a Range struct.
public static double Random(System.Random? random, DiGi.Core.Classes.Range<double>? range, double tolerance=0.001);random System.Random
The Random instance.
range DiGi.Core.Classes.Range<System.Double>
The range.
tolerance System.Double
The tolerance.
System.Double
A random double.
Generates a random integer within a Range struct.
public static int Random(System.Random? random, DiGi.Core.Classes.Range<int>? range);random System.Random
The Random instance.
range DiGi.Core.Classes.Range<System.Int32>
The range.
System.Int32
A random integer.
Generates a random double within a range.
public static double Random(System.Random? random, double start, double end, double tolerance=0.001);random System.Random
The Random instance.
start System.Double
The start value.
end System.Double
The end value.
tolerance System.Double
The tolerance.
System.Double
A random double.
Generates a random integer within a range.
public static int Random(System.Random? random, int start, int end);random System.Random
The Random instance.
start System.Int32
The start value.
end System.Int32
The end value.
System.Int32
A random integer.
Generates a list of random doubles within a specified Range using an optional seed.
public static System.Collections.Generic.List<double>? Randoms(int count, DiGi.Core.Classes.Range<double>? range, int seed=-1, double tolerance=0.001);count System.Int32
The number of random doubles to generate.
range DiGi.Core.Classes.Range<System.Double>
The range from which the random doubles are generated.
seed System.Int32
An optional seed for the random number generator.
tolerance System.Double
The tolerance value used during generation.
System.Collections.Generic.List<System.Double>
A list of random doubles, or null if generation fails.
Generates a list of random integers within a specified Range using an optional seed.
public static System.Collections.Generic.List<int>? Randoms(int count, DiGi.Core.Classes.Range<int>? range, int seed=-1);count System.Int32
The number of random integers to generate.
range DiGi.Core.Classes.Range<System.Int32>
The range from which the random integers are generated.
seed System.Int32
An optional seed for the random number generator.
System.Collections.Generic.List<System.Int32>
A list of random integers, or null if generation fails.
Generates a list of random doubles within a specified range using an optional seed.
public static System.Collections.Generic.List<double>? Randoms(int count, double start, double end, int seed=-1, double tolerance=0.001);count System.Int32
The number of random doubles to generate.
start System.Double
The start value of the range.
end System.Double
The end value of the range.
seed System.Int32
An optional seed for the random number generator.
tolerance System.Double
The tolerance value used during generation.
System.Collections.Generic.List<System.Double>
A list of random doubles, or null if generation fails.
Generates a list of random booleans using an optional seed.
public static System.Collections.Generic.List<bool>? Randoms(int count, int seed=-1);count System.Int32
The number of random booleans to generate.
seed System.Int32
The seed for the random number generator. Defaults to -1.
System.Collections.Generic.List<System.Boolean>
A list of random booleans, or null if generation fails.
Generates a list of random integers within a specified range using an optional seed.
public static System.Collections.Generic.List<int>? Randoms(int count, int start, int end, int seed=-1);count System.Int32
The number of random integers to generate.
start System.Int32
The inclusive lower bound of the range.
end System.Int32
The exclusive upper bound of the range.
seed System.Int32
The seed for the random number generator. Defaults to -1.
System.Collections.Generic.List<System.Int32>
A list of random integers, or null if generation fails.
Generates a list of random booleans using a provided Random instance.
public static System.Collections.Generic.List<bool>? Randoms(int count, System.Random? random);count System.Int32
The number of random booleans to generate.
random System.Random
The Random instance used to generate the values.
System.Collections.Generic.List<System.Boolean>
A list of random booleans, or null if generation fails.
Generates a list of random doubles within a specified Range using a provided Random instance.
public static System.Collections.Generic.List<double>? Randoms(int count, System.Random? random, DiGi.Core.Classes.Range<double>? range, double tolerance=0.001);count System.Int32
The number of random doubles to generate.
random System.Random
The Random instance to use for generation.
range DiGi.Core.Classes.Range<System.Double>
The range from which the random doubles are generated.
tolerance System.Double
The tolerance value used during generation.
System.Collections.Generic.List<System.Double>
A list of random doubles, or null if generation fails.
Generates a list of random integers within a specified Range using a provided Random instance.
public static System.Collections.Generic.List<int>? Randoms(int count, System.Random? random, DiGi.Core.Classes.Range<int>? range);count System.Int32
The number of random integers to generate.
random System.Random
The Random instance used to generate the values.
range DiGi.Core.Classes.Range<System.Int32>
The range within which the random integers should be generated.
System.Collections.Generic.List<System.Int32>
A list of random integers, or null if generation fails.
Generates a list of random doubles within a specified range using a provided Random instance.
public static System.Collections.Generic.List<double>? Randoms(int count, System.Random? random, double start, double end, double tolerance=0.001);count System.Int32
The number of random doubles to generate.
random System.Random
The Random instance to use for generation.
start System.Double
The start value of the range.
end System.Double
The end value of the range.
tolerance System.Double
The tolerance value used during generation.
System.Collections.Generic.List<System.Double>
A list of random doubles, or null if generation fails.
Generates a list of random integers within a specified range using a provided Random instance.
public static System.Collections.Generic.List<int>? Randoms(int count, System.Random? random, int start, int end);count System.Int32
The number of random integers to generate.
random System.Random
The Random instance used to generate the values.
start System.Int32
The inclusive lower bound of the range.
end System.Int32
The exclusive upper bound of the range.
System.Collections.Generic.List<System.Int32>
A list of random integers, or null if generation fails.
Rounds the value to the nearest multiple of the tolerance using decimal precision. This prevents floating-point artifacts common in double arithmetic.
public static double Round(this double value, double tolerance);value System.Double
The value to be rounded.
tolerance System.Double
The tolerance used for rounding.
System.Double
The rounded value.
Generates a sequence of seeds.
public static System.Collections.Generic.List<int> Seeds(this int count, int seed=-1);count System.Int32
The number of seeds to generate.
seed System.Int32
The starting seed value.
System.Collections.Generic.List<System.Int32>
A list of integers representing the seeds.
Retrieves the properties and fields of a type that are marked for serialization.
public static System.Collections.Generic.List<System.Reflection.MemberInfo>? SerializableMemberInfos(this System.Type? type);type System.Type
The type to reflect on.
System.Collections.Generic.List<System.Reflection.MemberInfo>
A list of serializable MemberInfo objects.
Gets the serializable name (e.g. from JsonPropertyNameAttribute) for a MemberInfo.
public static string? SerializableName(this System.Reflection.MemberInfo? memberInfo);memberInfo System.Reflection.MemberInfo
The MemberInfo.
System.String
The serializable name.
Gets the serialization order of the specified member, as defined by the System.Text.Json.Serialization.JsonPropertyOrderAttribute.
public static System.Nullable<int> SerializableOrder(this System.Reflection.MemberInfo? memberInfo);memberInfo System.Reflection.MemberInfo
The member to evaluate.
System.Nullable<System.Int32>
The serialization order if the attribute is present; otherwise, null.
Splits a sequence into a list of smaller lists, each containing at most maxCount elements.
public static System.Collections.Generic.List<System.Collections.Generic.List<X>>? Split<X>(this System.Collections.Generic.IEnumerable<X>? values, int maxCount);X
The type of elements in the sequence.
values System.Collections.Generic.IEnumerable<X>
The sequence to split.
maxCount System.Int32
The maximum number of elements per chunk.
System.Collections.Generic.List<System.Collections.Generic.List<X>>
A list of lists, or null if the input is null or maxCount is less than 1.
Converts a UTC enum value to its corresponding numeric hour offset from UTC.
public static double TimeOffset(this DiGi.Core.Enums.UTC uTC);uTC UTC
The UTC timezone enum value.
System.Double
The numeric hour offset (e.g., 2.0 for UTC+2), or NaN if undefined.
Attempts to convert the specified object using a DataType enum to determine the target type.
public static bool TryConvert(this object? @object, out object? result, DiGi.Core.Enums.DataType dataType);object System.Object
The object to convert.
result System.Object
When this method returns, contains the converted object, or null if conversion failed.
dataType DataType
The DataType enum value indicating the target type.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to the target type.
public static bool TryConvert(this object? @object, out object? result, System.Type? type);object System.Object
The object to convert.
result System.Object
When this method returns, contains the converted object, or null if conversion failed.
type System.Type
The target type to convert to.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert a System.Text.Json.JsonElement to the specified target type.
public static bool TryConvert(this System.Text.Json.JsonElement jsonElement, out object? result, System.Type type);jsonElement System.Text.Json.JsonElement
The JsonElement to convert.
result System.Object
When this method returns, contains the converted object, or null if conversion failed.
type System.Type
The target type to convert to.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to the target type T.
public static bool TryConvert<T>(this object? @object, out T? result);T
The target type to convert to.
object System.Object
The object to convert.
result T
When this method returns, contains the converted value, or default if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable boolean.
public static bool TryConvert_Boolean(object @object, out System.Nullable<bool> result);object System.Object
The object to convert.
result System.Nullable<System.Boolean>
When this method returns, contains the converted bool, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable byte.
public static bool TryConvert_Byte(object @object, out System.Nullable<byte> result);object System.Object
The object to convert.
result System.Nullable<System.Byte>
When this method returns, contains the converted byte, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable char.
public static bool TryConvert_Char(object @object, out System.Nullable<char> result);object System.Object
The object to convert.
result System.Nullable<System.Char>
When this method returns, contains the converted char value if successful; otherwise, null.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable System.Drawing.Color.
public static bool TryConvert_Color(object @object, out System.Nullable<System.Drawing.Color> result);object System.Object
The object to convert.
result System.Nullable<System.Drawing.Color>
When this method returns, contains the converted Color, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable System.DateTime.
public static bool TryConvert_DateTime(object @object, out System.Nullable<System.DateTime> result);object System.Object
The object to convert.
result System.Nullable<System.DateTime>
When this method returns, contains the converted DateTime, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable DateTimeOffset.
public static bool TryConvert_DateTimeOffset(object @object, out System.Nullable<System.DateTimeOffset> result);object System.Object
The object to convert.
result System.Nullable<System.DateTimeOffset>
When this method returns, contains the converted DateTimeOffset, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable decimal.
public static bool TryConvert_Decimal(object @object, out System.Nullable<decimal> result);object System.Object
The object to convert.
result System.Nullable<System.Decimal>
When this method returns, contains the converted decimal, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable double.
public static bool TryConvert_Double(object @object, out System.Nullable<double> result);object System.Object
The object to convert.
result System.Nullable<System.Double>
When this method returns, contains the converted double, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to an Enum of the specified type.
public static bool TryConvert_Enum(object @object, out System.Enum? result, System.Type type);object System.Object
The object to convert.
result System.Enum
When this method returns, contains the converted Enum, or null if conversion failed.
type System.Type
The target enum type.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to an IEnumerable of the specified type.
public static bool TryConvert_Enumerable(object @object, out System.Collections.IEnumerable? result, System.Type type);object System.Object
The object to convert.
result System.Collections.IEnumerable
When this method returns, contains the converted IEnumerable, or null if conversion failed.
type System.Type
The target enumerable type.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable float.
public static bool TryConvert_Float(object @object, out System.Nullable<float> result);object System.Object
The object to convert.
result System.Nullable<System.Single>
When this method returns, contains the converted float, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable System.Guid.
public static bool TryConvert_Guid(object @object, out System.Nullable<System.Guid> result);object System.Object
The object to convert.
result System.Nullable<System.Guid>
When this method returns, contains the converted Guid, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable int.
public static bool TryConvert_Int(object @object, out System.Nullable<int> result);object System.Object
The object to convert.
result System.Nullable<System.Int32>
When this method returns, contains the converted int, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a System.Text.Json.Nodes.JsonNode.
public static bool TryConvert_JsonNode(object @object, out System.Text.Json.Nodes.JsonNode? result);object System.Object
The object to convert.
result System.Text.Json.Nodes.JsonNode
When this method returns, contains the converted JsonNode, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable long.
public static bool TryConvert_Long(object @object, out System.Nullable<long> result);object System.Object
The object to convert.
result System.Nullable<System.Int64>
When this method returns, contains the converted long, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable sbyte.
public static bool TryConvert_Sbyte(object @object, out System.Nullable<sbyte> result);object System.Object
The object to convert.
result System.Nullable<System.SByte>
When this method returns, contains the converted sbyte value if successful; otherwise, null.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to an ISerializableObject of the specified type.
public static bool TryConvert_SerializableObject(object @object, out DiGi.Core.Interfaces.ISerializableObject? result, System.Type type);object System.Object
The object to convert.
result ISerializableObject
When this method returns, contains the converted ISerializableObject, or null if conversion failed.
type System.Type
The target ISerializableObject type.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable short.
public static bool TryConvert_Short(object @object, out System.Nullable<short> result);object System.Object
The object to convert.
result System.Nullable<System.Int16>
When this method returns, contains the converted short, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a nullable string.
public static bool TryConvert_String(this object? @object, out string? result);object System.Object
The object to convert.
result System.String
When this method returns, contains the converted string, or null if conversion failed.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a System.TimeSpan.
public static bool TryConvert_TimeSpan(object @object, out System.Nullable<System.TimeSpan> result);object System.Object
The object to convert.
result System.Nullable<System.TimeSpan>
When this method returns, contains the converted TimeSpan value if successful; otherwise, the default value.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to a System.Type.
public static bool TryConvert_Type(object @object, out System.Type? result);object System.Object
The object to convert.
result System.Type
When this method returns, contains the converted Type value if successful; otherwise, the default value.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to an unsigned integer (uint).
public static bool TryConvert_Uint(object @object, out System.Nullable<uint> result);object System.Object
The object to convert.
result System.Nullable<System.UInt32>
When this method returns, contains the converted uint value if successful; otherwise, the default value.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to an unsigned long (ulong).
public static bool TryConvert_Ulong(object @object, out System.Nullable<ulong> result);object System.Object
The object to convert.
result System.Nullable<System.UInt64>
When this method returns, contains the converted ulong value if successful; otherwise, the default value.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to convert the specified object to an unsigned short (ushort).
public static bool TryConvert_Ushort(object @object, out System.Nullable<ushort> result);object System.Object
The object to convert.
result System.Nullable<System.UInt16>
When this method returns, contains the converted ushort value if successful; otherwise, the default value.
System.Boolean
True if the conversion was successful; otherwise, false.
Attempts to parse a "TypeFullName:EnumValueName" formatted string into an Enum value.
public static bool TryGetEnum(string? text, out System.Enum? @enum);text System.String
The text in "TypeFullName:EnumValueName" format.
enum System.Enum
When this method returns, contains the parsed Enum value, or null if parsing failed.
System.Boolean
True if the parsing was successful; otherwise, false.
Attempts to parse a string into an enum value by checking names, descriptions, and fuzzy matching.
public static bool TryGetEnum(this string? text, System.Type? type, out System.Enum? @enum);text System.String
The string text to be parsed.
type System.Type
The type of the enum to parse into.
enum System.Enum
When this method returns, contains the parsed enum value if successful; otherwise, null.
System.Boolean
True if the string was successfully parsed into an enum value; otherwise, false.
Attempts to parse a string into a strongly-typed enum value of type TEnum.
public static bool TryGetEnum<TEnum>(this string? text, out TEnum? @enum)
where TEnum : System.Enum;TEnum
The target enum type.
text System.String
The text to parse.
enum TEnum
When this method returns, contains the parsed TEnum value, or default if parsing failed.
System.Boolean
True if the parsing was successful; otherwise, false.
Attempts to find the first key in the dictionary whose transformed value matches the transformed text.
public static bool TryGetFirstKey<T>(this System.Collections.Generic.IDictionary<string,T>? dictionary, string? text, out string? key, System.Func<string?,string?>? func=null);T
The type of the dictionary values.
dictionary System.Collections.Generic.IDictionary<System.String,T>
The dictionary to search.
text System.String
The text to match against.
key System.String
When this method returns, contains the first matching key, or null if not found.
func System.Func<System.String,System.String>
An optional transformation function applied to both the text and dictionary keys before comparison.
System.Boolean
True if a matching key was found; otherwise, false.
Attempts to find all keys in the dictionary whose transformed value matches the transformed text.
public static bool TryGetKeys<T>(this System.Collections.Generic.IDictionary<string,T>? dictionary, string? text, out System.Collections.Generic.List<string>? keys, System.Func<string?,string?>? func=null);T
The type of the dictionary values.
dictionary System.Collections.Generic.IDictionary<System.String,T>
The dictionary to search.
text System.String
The text to match against.
keys System.Collections.Generic.List<System.String>
When this method returns, contains a list of all matching keys, or null if none were found.
func System.Func<System.String,System.String>
An optional transformation function applied to both the text and dictionary keys before comparison.
System.Boolean
True if one or more matching keys were found; otherwise, false.
Query.TryGetLowerValue<TKey,TValue>(this SortedDictionary<TKey,TValue>, TKey, TValue, bool, bool) Method
Attempts to get the value associated with the nearest key less than or equal to the specified key in a sorted dictionary.
public static bool TryGetLowerValue<TKey,TValue>(this System.Collections.Generic.SortedDictionary<TKey,TValue>? sortedDictionary, TKey? key, out TValue? value, bool lowerLimit=true, bool upperLimit=false)
where TKey : System.IComparable<TKey>;TKey
The type of the keys, which must be comparable.
TValue
The type of the values.
sortedDictionary System.Collections.Generic.SortedDictionary<TKey,TValue>
The sorted dictionary to search.
key TKey
The key to look up or find the nearest lower key for.
value TValue
When this method returns, contains the associated value, or default if not found.
lowerLimit System.Boolean
If true, returns false when the key is below the minimum key. If false, clamps to the minimum.
upperLimit System.Boolean
If true, returns false when the key is above the maximum key. If false, clamps to the maximum.
System.Boolean
True if a value was found; otherwise, false.
Attempts to retrieve the unique identifier of the specified object.
public static bool TryGetUniqueId(this object? @object, out string? uniqueId);object System.Object
The object whose unique ID to retrieve.
uniqueId System.String
When this method returns, contains the unique identifier string, or null if it could not be determined.
System.Boolean
True if the unique ID was successfully retrieved; otherwise, false.
Attempts to parse the specified string into an IReference.
public static bool TryParse(this string? value, out DiGi.Core.Interfaces.IReference? reference);value System.String
The string to parse.
reference IReference
When this method returns, contains the parsed IReference if successful; otherwise, null.
System.Boolean
True if the string was successfully parsed; otherwise, false.
Attempts to parse the specified string into a UReference.
public static bool TryParse<UReference>(this string? value, out UReference? reference)
where UReference : DiGi.Core.Interfaces.IReference;UReference
The type of reference to parse.
value System.String
The string to parse.
reference UReference
When this method returns, contains the parsed UReference if successful; otherwise, null.
System.Boolean
True if the string was successfully parsed; otherwise, false.
Attempts to parse the specified string into a double-precision floating-point number.
public static bool TryParseDouble(this string value, out double result);value System.String
The string containing the double-precision floating-point number to parse.
result System.Double
When this method returns, contains the parsed value if the conversion was successful; otherwise, zero.
System.Boolean
true if the string was successfully parsed; otherwise, false.
Gets the Type associated with the specified TypeReference.
public static System.Type? Type(this DiGi.Core.Classes.TypeReference? typeReference);typeReference TypeReference
The type reference to get the type for.
System.Type
The Type associated with the specified TypeReference, or null if not found.
Gets the Type associated with the specified DataType.
public static System.Type? Type(this DiGi.Core.Enums.DataType dataType);dataType DataType
The data type to get the type for.
System.Type
The Type associated with the specified DataType, or null if not found.
Gets the Type associated with the specified type name.
public static System.Type? Type(this string? typeName, bool ignoreCase=false);typeName System.String
The name of the type to search for.
ignoreCase System.Boolean
Whether to ignore case during comparison.
System.Type
The Type associated with the specified type name, or null if not found.
Gets the Type associated with the specified type name using custom comparison and assembly filtering.
public static System.Type? Type(this string? typeName, DiGi.Core.Enums.TextComparisonType textComparisonType, bool ignoreCase=false, System.Func<System.Reflection.Assembly,bool>? func=null);typeName System.String
The name of the type to search for.
textComparisonType TextComparisonType
The type of text comparison to use.
ignoreCase System.Boolean
Whether to ignore case during comparison.
func System.Func<System.Reflection.Assembly,System.Boolean>
A function used to filter assemblies.
System.Type
The Type associated with the specified type name, or null if not found.
Computes a unique hash for the specified string.
public static ulong UniqueHash(this string? @string, ulong hash=14695981039346656037uL);string System.String
The string to hash.
hash System.UInt64
The initial hash value (offset basis).
System.UInt64
The computed unique hash as a ulong.
Computes a unique hash for the specified JsonNode.
public static ulong UniqueHash(this System.Text.Json.Nodes.JsonNode? jsonNode, ulong hash=14695981039346656037uL);jsonNode System.Text.Json.Nodes.JsonNode
The JsonNode to hash.
hash System.UInt64
The initial hash value (offset basis).
System.UInt64
The computed unique hash as a ulong.
Generates a unique identifier for the specified JsonArray.
public static string UniqueId(System.Text.Json.Nodes.JsonArray? value);value System.Text.Json.Nodes.JsonArray
The JsonArray to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified JsonNode.
public static string UniqueId(System.Text.Json.Nodes.JsonNode? value);value System.Text.Json.Nodes.JsonNode
The JsonNode to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified JsonValue.
public static string UniqueId(System.Text.Json.Nodes.JsonValue? value);value System.Text.Json.Nodes.JsonValue
The JsonValue to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified boolean.
public static string UniqueId(this bool value);value System.Boolean
The boolean value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified decimal.
public static string UniqueId(this decimal value);value System.Decimal
The decimal value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified ISerializableObject.
public static string UniqueId(this DiGi.Core.Interfaces.ISerializableObject? serializableObject);serializableObject ISerializableObject
The serializable object to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified IUniqueObject.
public static string UniqueId(this DiGi.Core.Interfaces.IUniqueObject? uniqueObject);uniqueObject IUniqueObject
The unique object to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified double.
public static string UniqueId(this double value);value System.Double
The double value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified float.
public static string UniqueId(this float value);value System.Single
The float value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified integer.
public static string UniqueId(this int value);value System.Int32
The integer to generate an identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified long.
public static string UniqueId(this long value);value System.Int64
The long value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified object.
public static string UniqueId(this object? @object);object System.Object
The object to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified short.
public static string UniqueId(this short value);value System.Int16
The short value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified string.
public static string UniqueId(this string? value);value System.String
The string value to generate a unique identifier for.
System.String
A unique identifier as a string.
Generates a unique identifier for the specified DateTime.
public static string UniqueId(this System.DateTime value);value System.DateTime
The DateTime value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable Enum.
public static string UniqueId(this System.Enum? @enum);enum System.Enum
The nullable Enum to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified Guid.
public static string UniqueId(this System.Guid guid);guid System.Guid
The Guid to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable boolean.
public static string UniqueId(this System.Nullable<bool> value);value System.Nullable<System.Boolean>
The nullable boolean value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable decimal.
public static string UniqueId(this System.Nullable<decimal> value);value System.Nullable<System.Decimal>
The nullable decimal to generate an identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable double.
public static string UniqueId(this System.Nullable<double> value);value System.Nullable<System.Double>
The nullable double value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable float.
public static string UniqueId(this System.Nullable<float> value);value System.Nullable<System.Single>
The nullable float value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable integer.
public static string UniqueId(this System.Nullable<int> value);value System.Nullable<System.Int32>
The nullable integer to generate an identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable long.
public static string UniqueId(this System.Nullable<long> value);value System.Nullable<System.Int64>
The nullable long value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable short.
public static string UniqueId(this System.Nullable<short> value);value System.Nullable<System.Int16>
The nullable short value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable DateTime.
public static string UniqueId(this System.Nullable<System.DateTime> value);value System.Nullable<System.DateTime>
The nullable DateTime to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable Guid.
public static string UniqueId(this System.Nullable<System.Guid> guid);guid System.Nullable<System.Guid>
The nullable Guid to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable unsigned integer.
public static string UniqueId(this System.Nullable<uint> value);value System.Nullable<System.UInt32>
The nullable unsigned integer to generate an identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified nullable ulong.
public static string UniqueId(this System.Nullable<ulong> value);value System.Nullable<System.UInt64>
The nullable ulong value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified JsonObject.
public static string UniqueId(this System.Text.Json.Nodes.JsonObject? value);value System.Text.Json.Nodes.JsonObject
The JsonObject to generate a unique identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified unsigned integer.
public static string UniqueId(this uint value);value System.UInt32
The unsigned integer to generate an identifier for.
System.String
A string representing the unique identifier.
Generates a unique identifier for the specified ulong.
public static string UniqueId(this ulong value);value System.UInt64
The ulong value to generate a unique identifier for.
System.String
A string representing the unique identifier.
Extracts the value from a System.Text.Json.Nodes.JsonNode cast to the specified type.
public static object? Value(this System.Text.Json.Nodes.JsonNode? jsonNode, System.Type? type);jsonNode System.Text.Json.Nodes.JsonNode
The JSON node to extract the value from.
type System.Type
The target type to cast the value to.
System.Object
The extracted value cast to the specified type, or null if the operation fails or the input is null.
Generates an array of integers within the specified range.
public static int[]? Values(this DiGi.Core.Classes.Range<int>? range);range DiGi.Core.Classes.Range<System.Int32>
The range from which to generate values.
System.Int32[]
An array containing all integer values in the range, or null if the range is null.
Provides global settings and managers for the DiGi.Core library.
public static class SettingsInheritance System.Object → Settings
Gets the manager responsible for conversion tasks.
public static DiGi.Core.Classes.ConversionManager ConversionManager { get; }Gets the manager responsible for serialization tasks.
public static DiGi.Core.Classes.SerializationManager SerializationManager { get; }