# mitchcapper/kpentrytemplates architecture

> Architecture diagram of the GitHub repository mitchcapper/kpentrytemplates, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mitchcapper/kpentrytemplates
- Repository: https://github.com/mitchcapper/kpentrytemplates

## Overview

KP Entry Templates is a KeePass plugin that adds a template-authoring and template-driven entry experience to KeePass databases. The main workflow is to define a template in the configured group, assign it as a parent to an entry, edit the child through generated controls, and save its values with the entry. The graph also includes documented context-menu, password-confirmation, field-type, and resize capabilities. Relationships involving unsampled implementation details are shown only where documented; the excerpts do not expose every event handler or persistence path.

Main entry points: [`KPEntryTemplates/KPEntryTemplates.cs`](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs) (Plugin hooks), [`KPEntryTemplates/EntryTemplateManager.TemplateEditor.cs`](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.TemplateEditor.cs) (Template editor), [`KPEntryTemplates/EntryTemplateManager.cs`](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs) (Entry tab manager), [`KPEntryTemplates/EntryTemplateManager.ChildViewer.cs`](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.ChildViewer.cs) (Child control builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["KeePass Integration"]
  node_plugin_hooks["Plugin hooks"]
  node_context_menu["Entry context menus"]
  node_copy_string["Template string copy"]
end

subgraph group_templates["Template Management"]
  node_template_group["Template group lookup"]
  node_template_chooser["Parent chooser"]
  node_parent_assignment["Parent assignment"]
  node_template_editor["Template editor"]
  node_entry_creation["Template-based creation"]
end

subgraph group_entry_ui["Entry Editing"]
  node_entry_manager["Entry tab manager"]
  node_child_builder["Child control builder"]
  node_password_check["Password confirmation"]
end

subgraph group_entry_data["Entry Data"]
  node_template_metadata["Template metadata"]
  node_field_binding["Field value binding"]
end

subgraph group_support["UI Support"]
  node_field_options["Field options dialog<br/>[OptionsForm.cs]"]
  node_option_button["Option button cell"]
  node_resize_support["Template UI resizing"]
end

node_user(("KeePass user"))
node_keepass["KeePass host"]
node_database[("KeePass database")]

node_user -->|"opens entries"| node_keepass
node_keepass -->|"loads plugin"| node_plugin_hooks
node_plugin_hooks -->|"creates manager"| node_entry_manager
node_entry_manager -->|"checks group"| node_template_group
node_user -->|"defines fields"| node_template_editor
node_template_editor -->|"stores template"| node_template_metadata
node_user -->|"chooses parent"| node_template_chooser
node_template_chooser -->|"lists templates"| node_template_group
node_template_chooser -->|"selects parent"| node_parent_assignment
node_parent_assignment -->|"updates entry"| node_database
node_entry_manager -->|"shows child view"| node_child_builder
node_child_builder -->|"reads definition"| node_template_metadata
node_child_builder -->|"builds controls"| node_field_binding
node_field_binding -->|"saves field values"| node_database
node_entry_manager -->|"checks before save"| node_password_check
node_plugin_hooks -->|"handles creation"| node_entry_creation
node_entry_creation -->|"marks child entry"| node_database
node_user -->|"opens menu"| node_context_menu
node_context_menu -->|"assigns parent"| node_parent_assignment
node_context_menu -->|"offers copy"| node_copy_string
node_copy_string -->|"copies to clipboard"| node_keepass
node_template_editor -->|"opens options"| node_field_options
node_template_editor -->|"enables options"| node_option_button
node_plugin_hooks -->|"resizes controls"| node_resize_support

click node_plugin_hooks "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs"
click node_entry_manager "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs"
click node_template_group "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs"
click node_template_chooser "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs"
click node_parent_assignment "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs"
click node_template_editor "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.TemplateEditor.cs"
click node_template_metadata "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs"
click node_child_builder "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.ChildViewer.cs"
click node_field_binding "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.ChildViewer.cs"
click node_password_check "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs"
click node_entry_creation "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs"
click node_context_menu "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs"
click node_copy_string "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs"
click node_field_options "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/OptionsForm.cs"
click node_option_button "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/DataGridViewDisableButton.cs"
click node_resize_support "https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin_hooks,node_context_menu,node_copy_string,node_user toneBlue
class node_template_group,node_template_chooser,node_parent_assignment,node_template_editor,node_entry_creation,node_database toneAmber
class node_entry_manager,node_child_builder,node_password_check toneMint
class node_template_metadata,node_field_binding toneRose
class node_field_options,node_option_button,node_resize_support,node_keepass toneIndigo
```

## Components

### KeePass Integration

- [Plugin hooks](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs): `KPEntryTemplates/KPEntryTemplates.cs`
- [Entry context menus](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs): `KPEntryTemplates/KPEntryTemplates.cs`
- [Template string copy](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs): `KPEntryTemplates/KPEntryTemplates.cs`

### Template Management

- [Template group lookup](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs): `KPEntryTemplates/EntryTemplateManager.cs`
- [Parent chooser](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs): `KPEntryTemplates/EntryTemplateManager.cs`
- [Parent assignment](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs): `KPEntryTemplates/EntryTemplateManager.cs`
- [Template editor](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.TemplateEditor.cs): `KPEntryTemplates/EntryTemplateManager.TemplateEditor.cs`
- [Template-based creation](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs): `KPEntryTemplates/KPEntryTemplates.cs`

### Entry Editing

- [Entry tab manager](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs): `KPEntryTemplates/EntryTemplateManager.cs`
- [Child control builder](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.ChildViewer.cs): `KPEntryTemplates/EntryTemplateManager.ChildViewer.cs`
- [Password confirmation](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs): `KPEntryTemplates/EntryTemplateManager.cs`

### Entry Data

- [Template metadata](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.cs): `KPEntryTemplates/EntryTemplateManager.cs`
- [Field value binding](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/EntryTemplateManager.ChildViewer.cs): `KPEntryTemplates/EntryTemplateManager.ChildViewer.cs`

### UI Support

- [Field options dialog](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/OptionsForm.cs): `KPEntryTemplates/OptionsForm.cs`
- [Option button cell](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/DataGridViewDisableButton.cs): `KPEntryTemplates/DataGridViewDisableButton.cs`
- [Template UI resizing](https://github.com/mitchcapper/KPEntryTemplates/blob/master/KPEntryTemplates/KPEntryTemplates.cs): `KPEntryTemplates/KPEntryTemplates.cs`

### Other components

- **KeePass user**
- **KeePass host**
- **KeePass database**

## Connections

- KeePass user → KeePass host: opens entries (evidence: `README.md`)
- KeePass host → Plugin hooks: loads plugin (evidence: `KPEntryTemplates/KPEntryTemplates.cs`)
- Plugin hooks → Entry tab manager: creates manager (evidence: `KPEntryTemplates/KPEntryTemplates.cs`)
- Entry tab manager → Template group lookup: checks group (evidence: `KPEntryTemplates/EntryTemplateManager.cs`)
- KeePass user → Template editor: defines fields (evidence: `README.md`)
- Template editor → Template metadata: stores template (evidence: `KPEntryTemplates/EntryTemplateManager.cs`)
- KeePass user → Parent chooser: chooses parent (evidence: `README.md`)
- Parent chooser → Template group lookup: lists templates (evidence: `KPEntryTemplates/EntryTemplateManager.cs`)
- Parent chooser → Parent assignment: selects parent (evidence: `KPEntryTemplates/EntryTemplateManager.cs`)
- Parent assignment → KeePass database: updates entry (evidence: `KPEntryTemplates/EntryTemplateManager.cs`)
- Entry tab manager → Child control builder: shows child view (evidence: `README.md`)
- Child control builder → Template metadata: reads definition (evidence: `README.md`)
- Child control builder → Field value binding: builds controls (evidence: `KPEntryTemplates/EntryTemplateManager.ChildViewer.cs`)
- Field value binding → KeePass database: saves field values (evidence: `README.md`)
- Entry tab manager → Password confirmation: checks before save (evidence: `KPEntryTemplates/EntryTemplateManager.cs`)
- Plugin hooks → Template-based creation: handles creation (evidence: `KPEntryTemplates/KPEntryTemplates.cs`)
- Template-based creation → KeePass database: marks child entry (evidence: `KPEntryTemplates/KPEntryTemplates.cs`)
- KeePass user → Entry context menus: opens menu (evidence: `README.md`)
- Entry context menus → Parent assignment: assigns parent (evidence: `KPEntryTemplates/KPEntryTemplates.cs`)
- Entry context menus → Template string copy: offers copy (evidence: `KPEntryTemplates/KPEntryTemplates.cs`)
- Template string copy → KeePass host: copies to clipboard (evidence: `KPEntryTemplates/KPEntryTemplates.cs`)
- Template editor → Field options dialog: opens options (evidence: `KPEntryTemplates/EntryTemplateManager.TemplateEditor.cs`)
- Template editor → Option button cell: enables options (evidence: `KPEntryTemplates/EntryTemplateManager.TemplateEditor.cs`)
- Plugin hooks → Template UI resizing: resizes controls (evidence: `KPEntryTemplates/KPEntryTemplates.cs`)
