Table of Contents

Class SourceGenTypeShape<T>

Namespace
PolyType.SourceGenModel
Assembly
PolyType.dll

Source generator model for type shapes.

public abstract class SourceGenTypeShape<T> : ITypeShape<T>, ITypeShape

Type Parameters

T

The type that the shape describes.

Inheritance
SourceGenTypeShape<T>
Implements
Derived
Inherited Members

Properties

AssociatedTypeShapes

Gets the shape of an associated type, by its name.

public Func<string, ITypeShape?>? AssociatedTypeShapes { get; init; }

Property Value

Func<string, ITypeShape>

CreateEventsFunc

Gets the factory method for creating event shapes.

public Func<IEnumerable<IEventShape>>? CreateEventsFunc { get; init; }

Property Value

Func<IEnumerable<IEventShape>>

CreateMethodsFunc

Gets the factory method for creating method shapes.

public Func<IEnumerable<IMethodShape>>? CreateMethodsFunc { get; init; }

Property Value

Func<IEnumerable<IMethodShape>>

Events

Gets all available event shapes for the given type.

public IReadOnlyList<IEventShape> Events { get; }

Property Value

IReadOnlyList<IEventShape>

An enumeration of all available method shapes.

Kind

Gets determines the TypeShapeKind that the current shape supports.

public abstract TypeShapeKind Kind { get; }

Property Value

TypeShapeKind

Methods

Gets all available method shapes for the given type.

public IReadOnlyList<IMethodShape> Methods { get; }

Property Value

IReadOnlyList<IMethodShape>

An enumeration of all available method shapes.

Provider

Gets the provider used to generate this instance.

public required ITypeShapeProvider Provider { get; init; }

Property Value

ITypeShapeProvider

Methods

Accept(TypeShapeVisitor, object?)

Accepts a TypeShapeVisitor for type graph traversal.

public abstract object? Accept(TypeShapeVisitor visitor, object? state = null)

Parameters

visitor TypeShapeVisitor

The visitor to accept.

state object

The state parameter to pass to the underlying visitor.

Returns

object

The object result returned by the visitor.