Skip to content
Concord

Class PatchDeclarationScanner

Namespace
Concord.Orchestration
Assembly
Concord.Orchestration.dll

The high-level Concord scanner. Reads classes marked with PatchAttribute as a unified patch declarations, then forwards their [Inject] methods for patch application and their declared fields for attached-property registration.

public static class PatchDeclarationScanner
Inheritance
PatchDeclarationScanner
Inherited Members

Methods

ScanAssembly(Assembly, IPatchApplier, IAttachedPropertyRegistry)

Scans every type in assembly and processes each PatchAttribute declaration. Per-type ConcordDeclarationExceptions are swallowed so one bad declaration cannot abort scanning the rest of the assembly.

public static void ScanAssembly(Assembly assembly, IPatchApplier patches, IAttachedPropertyRegistry props)

Parameters

assembly Assembly

The assembly to scan.

patches IPatchApplier

The applier that applies patches.

props IAttachedPropertyRegistry

The registry that registers attached-properties.

ScanDeclarations(IEnumerable<Type>, IPatchApplier, IAttachedPropertyRegistry)

Scans the given declaration types, tolerating per-declaration failures exactly like ScanAssembly(Assembly, IPatchApplier, IAttachedPropertyRegistry).

public static void ScanDeclarations(IEnumerable<Type> declarations, IPatchApplier patches, IAttachedPropertyRegistry props)

Parameters

declarations IEnumerable<Type>

The declaration types to scan.

patches IPatchApplier

The applier that applies patches.

props IAttachedPropertyRegistry

The registry that registers attached-properties.

ScanExtendedEnums(IEnumerable<Type>)

Registers every extended enum declaration among declarations and assigns their member fields. Callers run this before any injection, because an injection body can read a member. Per-declaration ConcordDeclarationExceptions are swallowed the same way ScanDeclarations(IEnumerable<Type>, IPatchApplier, IAttachedPropertyRegistry) swallows them.

public static void ScanExtendedEnums(IEnumerable<Type> declarations)

Parameters

declarations IEnumerable<Type>

The declaration types to inspect.

ScanType(Type, IPatchApplier, IAttachedPropertyRegistry)

Scans a single declaration: its [Inject] methods become patches and its declared fields become attached-properties on the resolved target base type. No-op when the type is not marked with PatchAttribute.

public static void ScanType(Type declaration, IPatchApplier patches, IAttachedPropertyRegistry props)

Parameters

declaration Type

The declaration class.

patches IPatchApplier

The applier that applies patches.

props IAttachedPropertyRegistry

The registry that registers attached-properties.

Exceptions

ConcordDeclarationException

Thrown when an explicit target disagrees with the class's base type, or a bare declaration has no usable target base type.

TryGetRegistryDeclarations(Assembly, out IReadOnlyList<Type>)

Resolves the assembly's generated patch registry, when one is present.

public static bool TryGetRegistryDeclarations(Assembly assembly, out IReadOnlyList<Type> declarations)

Parameters

assembly Assembly

The assembly to inspect.

declarations IReadOnlyList<Type>

The registry's declaration list, or empty when absent.

Returns

bool

true when a registry was found and resolved.

Exceptions

ConcordDeclarationException

Thrown when the registry type does not implement IPatchDeclarationProvider.