3.1 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-17T16:14:19.171251+00:00 | zai-org/GLM-5-FP8 | 1 | df0afddd9c0d4a5d |
ModuleCatalog
Purpose
This module provides an AggregateModuleCatalog class that implements the Prism IModuleCatalog interface to aggregate multiple module catalogs into a single unified catalog. It enables the application to combine modules from different catalog sources (e.g., configuration-based, directory-based, or dynamically loaded catalogs) while presenting them through a single interface to the Prism modularity system.
Public Interface
Class: AggregateModuleCatalog (implements IModuleCatalog)
-
AggregateModuleCatalog()- Constructor that initializes the aggregate catalog with a defaultMicrosoft.Practices.Prism.Modularity.ModuleCatalogas the first catalog. -
void AddCatalog(IModuleCatalog catalog)- Adds a module catalog to the aggregate. ThrowsArgumentNullExceptionifcatalogis null. -
IEnumerable<ModuleInfo> Modules(property) - Returns allModuleInfoinstances across all aggregated catalogs viaSelectMany. -
IEnumerable<ModuleInfo> GetDependentModules(ModuleInfo moduleInfo)- Returns dependent modules for the givenmoduleInfoby locating the owning catalog and delegating the call. UsesSingle()to find the catalog containing the module. -
IEnumerable<ModuleInfo> CompleteListWithDependencies(IEnumerable<ModuleInfo> modules)- Returns a complete list of modules including all dependencies. Groups modules by their owning catalog and delegates to each catalog'sCompleteListWithDependencies. -
void Initialize()- Initializes all aggregated catalogs by callingInitialize()on each. -
void AddModule(ModuleInfo moduleInfo)- Adds aModuleInfoto the first catalog in the list (_catalogs[0]).
Invariants
- The
_catalogslist is never null; it is initialized in the constructor and always contains at least one catalog (the defaultModuleCatalog). - The first catalog (
_catalogs[0]) is always an instance ofMicrosoft.Practices.Prism.Modularity.ModuleCatalog. AddCatalogwill throwArgumentNullExceptionif passed a null catalog.GetDependentModulesassumes eachModuleInfoexists in exactly one catalog; behavior is undefined if a module appears in multiple catalogs.
Dependencies
Depends on:
Microsoft.Practices.Prism.Modularity-IModuleCatalog,ModuleCatalog,ModuleInfo
Depended on by:
- Not determinable from source alone; likely consumed by application bootstrapping/initialization code.
Gotchas
AddModulealways adds to the first catalog only (_catalogs[0]), not to all catalogs or a user-specified catalog. This may cause confusion if developers expect modules to be distributed across catalogs.GetDependentModulesusesSingle()which will throwInvalidOperationExceptionif the module is not found in any catalog or exists in multiple catalogs.- The XML documentation comments reference
DataPro.Main.ModuleCatalogwhich appears to be a stale/incorrect reference; the actual class is