Table of Contents

Class AssemblyUtilities

Namespace
Alternet.Common
Assembly
Alternet.Common.v10.dll

Provides utility methods for working with assemblies and types.

public static class AssemblyUtilities
Inheritance
AssemblyUtilities

Fields

LibraryAlternetUICommon

Gets the 'Alternet.UI.Common' assembly if it is loaded in the current application domain.

LibraryMicrosoftMaui

Gets the 'Microsoft.Maui' assembly if it is loaded in the current application domain.

LibraryMicrosoftMauiEssentials

Gets the 'Microsoft.Maui.Essentials' assembly if it is loaded in the current application domain.

LibrarySystemDrawing

Gets the 'System.Drawing.Common' assembly if it is loaded in the current application domain.

MauiCacheDirectory

Gets the cache directory path for the current application if the 'Microsoft.Maui.Essentials' assembly is loaded.

TypeAlternetDrawingSystemColors

Gets the type for 'Alternet.Drawing.SystemColors' if the 'Alternet.UI.Common' assembly is loaded.

TypeMauiStorageFileSystem

Gets the type for 'Microsoft.Maui.Storage.FileSystem' if the 'Microsoft.Maui.Essentials' assembly is loaded.

TypeSystemDrawingSystemColors

Gets the type for 'System.Drawing.SystemColors' if the 'System.Drawing' assembly is loaded.

Methods

GetAssemblyByName(string)

Gets Assembly with the specified name searching it through all assemblies of the current domain.

GetExportedTypesSafe(Assembly?)

Gets the exported types from the specified assembly safely.

GetImplicitConversion(Type, Type)

Gets implicit conversion operator from one type to another.

GetOrLoadAssemblyByName(string)

Gets Assembly with the specified name searching it through all assemblies of the current domain. If assembly is not found, tries to load it.

GetTypeDescendants(Type, IEnumerable<Assembly>)

Returns list of types which descend from the specified type. Search is performed in the collection of assemblies.

GetTypeDescendants(Type, Assembly?)

Returns list of types which descend from the specified type. Search is performed in asm assembly or in assembly where type is declared if parameter is null.

GetTypesSafe(Assembly?)

Safely retrieves all types defined in the specified assembly.

HasConstructorNoParams(Type)

Determines whether the specified type has a parameterless constructor.

InvokeBoolMethod(Type?, string, object?, object[]?)

Invokes method with boolean result through the reflection.

InvokeBoolMethod<T>(string, object?, object[]?)

Invokes method with boolean result through the reflection.

IsVersionOrGreater(int, int, int)

Determines whether the current framework version is equal to or greater than the specified version.

RunActionForDerivedTypes(Type, Action<Type>)

Runs the action for all descendants of the specified type.

SafeCreateInstance(Type)

Safely creates an instance of the specified type if it has a parameterless constructor.

TypeIsDescendant(Type, Type)

Returns true if specified type is a descendant of another type.