Show / Hide Table of Contents

Class TypeExpression

Represents an expression that can be resolved to a defined type.

Inheritance
object
TypeExpression
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types
Assembly: MCART.dll
Syntax
public class TypeExpression

Constructors

| Edit this page View Source

TypeExpression(string)

Represents an expression that can be resolved to a defined type.

Declaration
public TypeExpression(string fullName)
Parameters
Type Name Description
string fullName

Full name of the type this expression references.

| Edit this page View Source

TypeExpression(Type)

Initializes a new instance of the TypeExpression, using the specified type as base.

Declaration
public TypeExpression(Type type)
Parameters
Type Name Description
Type type

Type from which to generate the TypeExpression.

Properties

| Edit this page View Source

FullName

Gets the full name of the type.

Declaration
public string FullName { get; }
Property Value
Type Description
string
| Edit this page View Source

GenericArgs

Gets a collection through which generic type arguments can be retrieved and set when resolving a type.

Declaration
public ICollection<TypeExpression> GenericArgs { get; }
Property Value
Type Description
ICollection<TypeExpression>
| Edit this page View Source

Name

Gets the name of the type.

Declaration
public string Name { get; }
Property Value
Type Description
string
| Edit this page View Source

Namespace

Gets the namespace of the type.

Declaration
public string Namespace { get; }
Property Value
Type Description
string

Methods

| Edit this page View Source

Resolve()

Resolves a type from this expression.

Declaration
[RequiresUnreferencedCode("The method obtains a collection of types without direct references, so it is not compatible with trimming.")]
[RequiresDynamicCode("The method dynamically creates new types, so it is not compatible with trimming.")]
public Type Resolve()
Returns
Type Description
Type

A resolved type from this expression.

Exceptions
Type Condition
MissingTypeException

Thrown if it was not possible to resolve the type from the expression represented by this instance.

| Edit this page View Source

Resolve(bool)

Resolves a type from this expression.

Declaration
[RequiresUnreferencedCode("The method obtains a collection of types without direct references, so it is not compatible with trimming.")]
[RequiresDynamicCode("The method dynamically creates new types, so it is not compatible with trimming.")]
public Type? Resolve(bool throwOnFail)
Parameters
Type Name Description
bool throwOnFail

true to throw an exception if it is not possible to resolve the type expression represented by this instance, false to return null instead.

Returns
Type Description
Type

A resolved type from this expression, or null if the expression cannot be resolved if throwOnFail is set to false.

Exceptions
Type Condition
MissingTypeException

Thrown if it was not possible to resolve the type from the expression represented by this instance if throwOnFail is set to true.

Operators

| Edit this page View Source

implicit operator Type(TypeExpression)

Implicitly converts a TypeExpression to a Type.

Declaration
[RequiresUnreferencedCode("The method obtains a collection of types without direct references, so it is not compatible with trimming.")]
[RequiresDynamicCode("The method dynamically creates new types, so it is not compatible with trimming.")]
public static implicit operator Type(TypeExpression expression)
Parameters
Type Name Description
TypeExpression expression

Object to convert.

Returns
Type Description
Type

Extension Methods

Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Common.IfNotNull<T>(T?, Action<T>)
Objects.Itself<T>(T)
Objects.ShallowCopyTo<T>(T, T)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX