init
This commit is contained in:
72
docs/ai/DataPRO/Modules/Database/DatabaseServices/View.md
Normal file
72
docs/ai/DataPRO/Modules/Database/DatabaseServices/View.md
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/Database/DatabaseServices/View/DatabaseStatusBarView.xaml.cs
|
||||
- DataPRO/Modules/Database/DatabaseServices/View/DatabaseCopyView.xaml.cs
|
||||
- DataPRO/Modules/Database/DatabaseServices/View/DatabaseSwitchView.xaml.cs
|
||||
generated_at: "2026-04-17T16:36:18.725754+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "9b3e32201b851fc1"
|
||||
---
|
||||
|
||||
# Documentation: Database View Components
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides WPF view components for database-related UI operations within the DatabaseServices namespace. It contains three code-behind classes—`DatabaseStatusBarView`, `DatabaseCopyView`, and `DatabaseSwitchView`—that serve as the visual layer for displaying database status, copying databases, and switching between local/remote database connections respectively. These views implement interfaces from `DTS.Common.Interface.Database` and delegate business logic to associated ViewModels via WPF data binding.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `DatabaseStatusBarView`
|
||||
**Namespace:** `DatabaseServices`
|
||||
**Implements:** `IDatabaseStatusBarView`
|
||||
|
||||
```csharp
|
||||
public DatabaseStatusBarView()
|
||||
```
|
||||
Default constructor. Calls `InitializeComponent()` to load the associated XAML layout. No additional public members are exposed beyond the interface implementation.
|
||||
|
||||
---
|
||||
|
||||
### `DatabaseCopyView`
|
||||
**Namespace:** `DatabaseServices`
|
||||
**Implements:** `IDatabaseCopyView`
|
||||
|
||||
```csharp
|
||||
public DatabaseCopyView()
|
||||
```
|
||||
Default constructor. Calls `InitializeComponent()` to load the associated XAML layout.
|
||||
|
||||
```csharp
|
||||
private void Copy_Click(object sender, RoutedEventArgs e)
|
||||
```
|
||||
Event handler for the copy button click. Casts `sender` to `Control`, retrieves the `DataContext` as `IDatabaseCopyViewModel`, and invokes `vm.CopyDatabase()`.
|
||||
|
||||
---
|
||||
|
||||
### `DatabaseSwitchView`
|
||||
**Namespace:** `DatabaseServices`
|
||||
**Implements:** `IDatabaseSwitchView`
|
||||
|
||||
```csharp
|
||||
public DatabaseSwitchView()
|
||||
```
|
||||
Default constructor. Calls `InitializeComponent()` to load the associated XAML layout.
|
||||
|
||||
```csharp
|
||||
private void SwitchToLocal_Click(object sender, RoutedEventArgs e)
|
||||
```
|
||||
Event handler for switching to local database. Casts `sender` to `Control`, retrieves the `DataContext` as `IDatabaseSwitchViewModel`, and invokes `vm.SwitchLocal()`.
|
||||
|
||||
```csharp
|
||||
private void SwitchToRemote_Click(object sender, RoutedEventArgs e)
|
||||
```
|
||||
Event handler for switching to remote database. Casts `sender` to `Control`, retrieves the `DataContext` as `IDatabaseSwitchViewModel`, and invokes `vm.SwitchRemote()`.
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **DataContext Contract:** `DatabaseCopyView` requires its `DataContext` to be an instance of `IDatabaseCopyViewModel`. `DatabaseSwitchView` requires its `DataContext` to be an instance of `IDatabaseSwitchViewModel`. Event handlers will fail with invalid
|
||||
Reference in New Issue
Block a user