53 lines
2.0 KiB
Markdown
53 lines
2.0 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.Common.CPU/CPUModule.cs
|
||
|
|
generated_at: "2026-04-17T16:38:14.448540+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "4fa44b6762649f96"
|
||
|
|
---
|
||
|
|
|
||
|
|
# Documentation: DTS.Common.CPU Module
|
||
|
|
|
||
|
|
## 1. Purpose
|
||
|
|
|
||
|
|
This module provides CPU-related functionality within a Prism-modular WPF application. It serves as a plugin module that registers CPU engine services with the Unity dependency injection container at runtime. The module also defines assembly-level metadata attributes (`CPUNameAttribute` and `CUPImageAttribute`) that expose the module's name and visual representation for display in the application's main screen component list.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 2. Public Interface
|
||
|
|
|
||
|
|
### CPUModule Class
|
||
|
|
|
||
|
|
**Signature:**
|
||
|
|
```csharp
|
||
|
|
[Export(typeof(IModule))]
|
||
|
|
[Module(ModuleName = "CPU")]
|
||
|
|
public class CPUModule : IModule
|
||
|
|
```
|
||
|
|
|
||
|
|
| Member | Signature | Description |
|
||
|
|
|--------|-----------|-------------|
|
||
|
|
| Constructor | `CPUModule(IUnityContainer unityContainer)` | Accepts a Unity container instance via constructor injection. Stores it in a readonly field `_unityContainer`. |
|
||
|
|
| Initialize | `void Initialize()` | Registers `ICPUEngine` mapped to `CPUEngine` with the Unity container. Contains commented-out registration for `IPropertyViewModel`. |
|
||
|
|
|
||
|
|
### CPUNameAttribute Class
|
||
|
|
|
||
|
|
**Signature:**
|
||
|
|
```csharp
|
||
|
|
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
|
||
|
|
public class CPUNameAttribute : TextAttribute
|
||
|
|
```
|
||
|
|
|
||
|
|
| Member | Signature | Description |
|
||
|
|
|--------|-----------|-------------|
|
||
|
|
| Constructor | `CPUNameAttribute()` | Default constructor, delegates to `CPUNameAttribute(null)`. |
|
||
|
|
| Constructor | `CPUNameAttribute(string s)` | Initializes `_assemblyName` to the literal string `"CPUAsssembly"`. The parameter `s` is unused. |
|
||
|
|
| AssemblyName | `override string AssemblyName { get; }` | Returns `_assemblyName` (`"CPUAsssembly"`). |
|
||
|
|
| GetAttributeType | `override Type GetAttributeType()` | Returns `typeof(TextAttribute)`. |
|
||
|
|
| GetAssemblyName | `override string GetAssemblyName()` | Returns the `AssemblyName` property value. |
|
||
|
|
|
||
|
|
### CUPImageAttribute Class
|
||
|
|
|
||
|
|
**Signature:**
|