# changbowen/desktopnote architecture

> Architecture diagram of the GitHub repository changbowen/desktopnote, 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/changbowen/desktopnote
- Repository: https://github.com/changbowen/desktopnote

## Overview

DesktopNote is a Windows desktop sticky-note application. Users create or reopen note windows, edit rich-text content, and have note content and per-note settings saved to files; they can also search, format, reset, and reposition notes. The graph includes the documented image, docking, and multiple-window capabilities, though their full implementations were not sampled. Edges are limited to relationships visible in excerpts or explicitly documented by the README.

Main entry points: [`MainWindow.xaml.cs`](https://github.com/changbowen/desktopnote/blob/master/MainWindow.xaml.cs) (Note window and editor), [`RoundedWindow.cs`](https://github.com/changbowen/desktopnote/blob/master/RoundedWindow.cs) (Shared window behavior), [`App.xaml.cs`](https://github.com/changbowen/desktopnote/blob/master/App.xaml.cs) (Application startup), [`Win_Format.xaml.cs`](https://github.com/changbowen/desktopnote/blob/master/Win_Format.xaml.cs) (Formatting controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["Application lifecycle"]
  node_app["Application startup<br/>[App.xaml.cs]"]
  node_single["Single-instance coordination<br/>[SingleInstance.cs]"]
end

subgraph group_notes["Notes and persistence"]
  node_main["Note window and editor<br/>[MainWindow.xaml.cs]"]
  node_helpers["Note file operations<br/>[Helpers.cs]"]
  node_settings["Note settings<br/>[Setting.cs]"]
  node_content["Note content files"]
end

subgraph group_interaction["Note interaction"]
  node_format["Formatting controls<br/>[Win_Format.xaml.cs]"]
  node_search["Note search<br/>[Win_Search.xaml.cs]"]
  node_options["Options and reset"]
end

subgraph group_windows["Window behavior"]
  node_rounded["Shared window behavior<br/>[RoundedWindow.cs]"]
  node_monitor["Monitor bounds"]
  node_winapi["Windows positioning APIs<br/>[WinAPI.cs]"]
end

node_user(("Desktop user"))

node_user -->|"starts app"| node_app
node_app -->|"checks instance"| node_single
node_app -->|"updates note list"| node_settings
node_user -->|"creates or edits"| node_main
node_main -->|"gets monitor bounds"| node_monitor
node_main -.->|"saves note"| node_helpers
node_helpers -->|"reads and writes"| node_content
node_settings -->|"serializes settings"| node_content
node_main -.->|"opens formatting"| node_format
node_format -->|"formats editor"| node_main
node_user -->|"searches note"| node_search
node_search -->|"selects text in"| node_main
node_user -->|"changes options"| node_options
node_options -->|"resets note"| node_main
node_main -->|"inherits window behavior"| node_rounded
node_format -->|"inherits window behavior"| node_rounded
node_search -->|"inherits window behavior"| node_rounded
node_options -->|"inherits window behavior"| node_rounded
node_main -.->|"positions windows"| node_winapi

click node_app "https://github.com/changbowen/desktopnote/blob/master/App.xaml.cs"
click node_single "https://github.com/changbowen/desktopnote/blob/master/SingleInstance.cs"
click node_main "https://github.com/changbowen/desktopnote/blob/master/MainWindow.xaml.cs"
click node_helpers "https://github.com/changbowen/desktopnote/blob/master/Helpers.cs"
click node_settings "https://github.com/changbowen/desktopnote/blob/master/Setting.cs"
click node_format "https://github.com/changbowen/desktopnote/blob/master/Win_Format.xaml.cs"
click node_search "https://github.com/changbowen/desktopnote/blob/master/Win_Search.xaml.cs"
click node_options "https://github.com/changbowen/desktopnote/blob/master/Win_Options.xaml.cs"
click node_rounded "https://github.com/changbowen/desktopnote/blob/master/RoundedWindow.cs"
click node_monitor "https://github.com/changbowen/desktopnote/blob/master/GetCurrentMonitor.cs"
click node_winapi "https://github.com/changbowen/desktopnote/blob/master/WinAPI.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_app,node_single,node_user toneBlue
class node_main,node_helpers,node_settings,node_content toneAmber
class node_format,node_search,node_options toneMint
class node_rounded,node_monitor,node_winapi toneRose
```

## Components

### Application lifecycle

- [Application startup](https://github.com/changbowen/desktopnote/blob/master/App.xaml.cs): `App.xaml.cs`
- [Single-instance coordination](https://github.com/changbowen/desktopnote/blob/master/SingleInstance.cs): `SingleInstance.cs`

### Notes and persistence

- [Note window and editor](https://github.com/changbowen/desktopnote/blob/master/MainWindow.xaml.cs): `MainWindow.xaml.cs`
- [Note file operations](https://github.com/changbowen/desktopnote/blob/master/Helpers.cs): `Helpers.cs`
- [Note settings](https://github.com/changbowen/desktopnote/blob/master/Setting.cs): `Setting.cs`
- **Note content files**

### Note interaction

- [Formatting controls](https://github.com/changbowen/desktopnote/blob/master/Win_Format.xaml.cs): `Win_Format.xaml.cs`
- [Note search](https://github.com/changbowen/desktopnote/blob/master/Win_Search.xaml.cs): `Win_Search.xaml.cs`
- [Options and reset](https://github.com/changbowen/desktopnote/blob/master/Win_Options.xaml.cs): `Win_Options.xaml.cs`

### Window behavior

- [Shared window behavior](https://github.com/changbowen/desktopnote/blob/master/RoundedWindow.cs): `RoundedWindow.cs`
- [Monitor bounds](https://github.com/changbowen/desktopnote/blob/master/GetCurrentMonitor.cs): `GetCurrentMonitor.cs`
- [Windows positioning APIs](https://github.com/changbowen/desktopnote/blob/master/WinAPI.cs): `WinAPI.cs`

### Other components

- **Desktop user**

## Connections

- Desktop user → Application startup: starts app
- Application startup → Single-instance coordination: checks instance (evidence: `App.xaml.cs`)
- Application startup → Note settings: updates note list (evidence: `App.xaml.cs`)
- Desktop user → Note window and editor: creates or edits (evidence: `README.md`)
- Note window and editor → Monitor bounds: gets monitor bounds (evidence: `MainWindow.xaml.cs`)
- Note window and editor → Note file operations: saves note (evidence: `MainWindow.xaml.cs`)
- Note file operations → Note content files: reads and writes (evidence: `Helpers.cs`)
- Note settings → Note content files: serializes settings
- Note window and editor → Formatting controls: opens formatting
- Formatting controls → Note window and editor: formats editor (evidence: `Win_Format.xaml.cs`)
- Desktop user → Note search: searches note (evidence: `README.md`)
- Note search → Note window and editor: selects text in (evidence: `Win_Search.xaml.cs`)
- Desktop user → Options and reset: changes options (evidence: `README.md`)
- Options and reset → Note window and editor: resets note (evidence: `Win_Options.xaml.cs`)
- Note window and editor → Shared window behavior: inherits window behavior (evidence: `MainWindow.xaml.cs`)
- Formatting controls → Shared window behavior: inherits window behavior (evidence: `Win_Format.xaml.cs`)
- Note search → Shared window behavior: inherits window behavior (evidence: `Win_Search.xaml.cs`)
- Options and reset → Shared window behavior: inherits window behavior (evidence: `Win_Options.xaml.cs`)
- Note window and editor → Windows positioning APIs: positions windows
