Vixen
02b45cc4
csharp
public static class TypeRegistry

Every annotated type in every loaded assembly.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Filled by a [ModuleInitializer] the generator emits per assembly, so referencing an assembly is enough for its types to be discoverable — there is no scan, no AppDomain.GetAssemblies, and nothing that stops working when the trimmer removes the metadata a scan would have read.

Registration is idempotent by type. An assembly loaded twice, or a module initializer that runs after a test has registered a descriptor by hand, replaces rather than duplicates.

Fields and properties (2)

  • public static int Count

    How many types are registered.

  • public static IEnumerable<TypeDescriptor> All

    Everything registered.

Methods (8)

  • public static int Evict(Assembly assembly)

    Forgets every type an assembly described.

  • public static void Register(TypeDescriptor descriptor)

    Registers a descriptor, replacing any previous one for the same type.

  • public static bool TryGet(Type type, out TypeDescriptor? descriptor)

    Finds the descriptor for a type.

  • public static bool TryGet<T>(out TypeDescriptor? descriptor)

    Finds the descriptor for a type.

  • public static bool TryGetByAlias(string alias, out TypeDescriptor? descriptor)

    Finds the descriptor registered under a name.

  • public static IEnumerable<TypeDescriptor> With(TypeTraits traits)

    Everything carrying all of .

  • public static IEnumerable<TypeDescriptor> AssignableTo<TBase>()

    Everything assignable to .

  • public static void Clear()

    Forgets everything. For tests that need an empty registry.

Used by (23)

  • ShellHelloUi
  • TypeRegistrationThirdPersonShooter
  • NestedMemberTestsVixen.Ui.Controls.Advanced.Tests
  • PropertyGridVixen.Ui.Controls.Advanced
  • PropertyGridTestsVixen.Ui.Controls.Advanced.Tests
  • SplineAssetTestsVixen.Core.Mathematics.Tests
  • TypeRegistryTestsVixen.Core.Reflection.Tests
  • YamlSerializerVixen.Core.Yaml
  • AnimationClipImporterTestsVixen.Editor.Assets.Tests
  • AssetImporterVixen.Editor.Assets
  • ConstraintAuthoringImporterTestsVixen.Editor.Assets.Tests
  • EditorScriptTestsVixen.Editor.Scripts.Tests
  • HarnessPlanImporterTestsVixen.Editor.Assets.Tests
  • ImportPipelineVixen.Editor.Assets
  • MaterialImporterTestsVixen.Editor.Assets.Tests
  • MoveSetImporterTestsVixen.Editor.Assets.Tests
  • ProjectAssembliesVixen.Editor.App
  • ProjectSettingsStoreVixen.Editor.Core
  • ProxyShapeImporterTestsVixen.Editor.Assets.Tests
  • ReflectedDescriptorVixen.Editor.Inspector
  • ReflectedTypeTestsVixen.Editor.Scripts.Tests
  • ReflectedTypesVixen.Editor.Scripts
  • ScriptModuleVixen.Editor.Scripts