Show / Hide Table of Contents

Class Type<T>.Constructor<P1, P2, P3, P4>

Provides access to constructor of type T with four parameters.

Inheritance
Object
Type<T>.Constructor<P1, P2, P3, P4>
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public static class Constructor<P1, P2, P3, P4> : object
Type Parameters
Name Description
P1

Type of first constructor parameter.

P2

Type of second constructor parameter.

P3

Type of third constructor parameter.

P4

Type of fourth constructor parameter.

Methods

| Improve this Doc View Source

Get(Boolean)

Returns constructor T with four parameters of type P1, P2, P3 and P4.

Declaration
public static Constructor<Func<P1, P2, P3, P4, T>> Get(bool nonPublic = false)
Parameters
Type Name Description
Boolean nonPublic

true to reflect non-public constructor.

Returns
Type Description
Constructor<Func<P1, P2, P3, P4, T>>

Reflected constructor with four parameters; or null, if it doesn't exist.

| Improve this Doc View Source

Invoke(P1, P2, P3, P4, Boolean)

Invokes constructor.

Declaration
public static T Invoke(P1 arg1, P2 arg2, P3 arg3, P4 arg4, bool nonPublic = false)
Parameters
Type Name Description
P1 arg1

First constructor argument.

P2 arg2

Second constructor argument.

P3 arg3

Third constructor argument.

P4 arg4

Fourth constructor argument.

Boolean nonPublic

true to reflect non-public constructor.

Returns
Type Description
T

Instance of T.

Exceptions
Type Condition
MissingConstructorException

Constructor doesn't exist.

| Improve this Doc View Source

Require(Boolean)

Returns constructor T with four parameters of type P1, P2, P3 and P4.

Declaration
public static Constructor<Func<P1, P2, P3, P4, T>> Require(bool nonPublic = false)
Parameters
Type Name Description
Boolean nonPublic

true to reflect non-public constructor.

Returns
Type Description
Constructor<Func<P1, P2, P3, P4, T>>

Reflected constructor with four parameters.

Exceptions
Type Condition
MissingConstructorException

Constructor doesn't exist.

| Improve this Doc View Source

TryInvoke(P1, P2, P3, P4, Boolean)

Invokes constructor.

Declaration
public static Optional<T> TryInvoke(P1 arg1, P2 arg2, P3 arg3, P4 arg4, bool nonPublic = false)
Parameters
Type Name Description
P1 arg1

First constructor argument.

P2 arg2

Second constructor argument.

P3 arg3

Third constructor argument.

P4 arg4

Fourth constructor argument.

Boolean nonPublic

true to reflect non-public constructor.

Returns
Type Description
Optional<T>

Instance of T if constructor exists.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX