Table of Contents

Method SafeCreateInstance

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

SafeCreateInstance(Type)

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

public static object? SafeCreateInstance(Type type)

Parameters

type Type

The Type to create an instance of.

Returns

object

An instance of the specified type if it has a parameterless constructor; otherwise, null.