# markmodi279/desktopswitcher architecture

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

- Interactive diagram: https://gitdiagram.com/markmodi279/desktopswitcher
- Repository: https://github.com/markmodi279/desktopswitcher

## Overview

DesktopSwitcher is a Windows 10 taskbar-docked virtual desktop switcher. The main workflow starts in Program, creates a Controller, and presents a numbered strip for switching, creating, removing, reordering, and naming desktops; shell notifications keep the desktop model current. Other documented capabilities include window actions and close-all, desktop marks, system statistics/public-IP actions, settings, animation, and install/uninstall. The graph combines README-documented behavior with indexed references and excerpts; unsampled implementation links are omitted or marked unverified rather than inferred as definite calls.

Main entry points: [`src/app/Controller.cs`](https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Controller.cs) (Controller), [`src/model/DesktopService.cs`](https://github.com/markmodi279/desktopswitcher/blob/main/src/model/DesktopService.cs) (Desktop service), [`src/ui/SwitcherStrip.cs`](https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/SwitcherStrip.cs) (Desktop strip), [`src/app/Program.cs`](https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Program.cs) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App lifecycle"]
  node_program["Application entry<br/>[Program.cs]"]
  node_controller["Controller<br/>[Controller.cs]"]
  node_installer["Install lifecycle<br/>[Installer.cs]"]
  node_config["Configuration<br/>[Config.cs]"]
end

subgraph group_desktop["Desktop management"]
  node_desktop_service["Desktop service<br/>[DesktopService.cs]"]
  node_desktop_model["Desktop model<br/>[Desktop.cs]"]
  node_shell_api["Virtual desktop API"]
  node_shell_notify["Shell notifications"]
  node_name_watcher["Name watcher"]
  node_window_inventory["Window inventory<br/>[WindowInventory.cs]"]
  node_window_closer["Window closing<br/>[WindowCloser.cs]"]
end

subgraph group_interface["Taskbar interface"]
  node_taskbar_host["Taskbar host<br/>[TaskbarHost.cs]"]
  node_switcher["Desktop strip<br/>[SwitcherStrip.cs]"]
  node_tooltip["Desktop hover panel<br/>[TooltipWindow.cs]"]
  node_settings["Settings window<br/>[SettingsWindow.cs]"]
  node_settings_controls["Setting controls"]
end

subgraph group_features["User features"]
  node_close_run["Close-all workflow<br/>[CloseAllRun.cs]"]
  node_close_panel["Close progress panel"]
  node_marks[("Desktop marks<br/>[MarkStore.cs]")]
  node_mark_sync["Mark synchronization<br/>[MarkSync.cs]"]
  node_mark_picker["Mark picker<br/>[MarkPicker.cs]"]
  node_stats["System statistics<br/>[SystemStats.cs]"]
  node_public_ip["Public IP lookup<br/>[PublicIp.cs]"]
end

node_user(("User"))
node_windows_shell["Windows shell"]

node_user -->|"launches"| node_program
node_program -->|"creates"| node_controller
node_program -->|"offers install"| node_installer
node_program -->|"loads"| node_config
node_controller -.->|"uses"| node_desktop_service
node_controller -.->|"controls"| node_switcher
node_controller -.->|"docks"| node_taskbar_host
node_controller -.->|"opens"| node_settings
node_desktop_service -->|"queries and changes"| node_shell_api
node_desktop_service -->|"registers notifications"| node_shell_notify
node_desktop_service -->|"watches names"| node_name_watcher
node_desktop_service -->|"builds model"| node_desktop_model
node_shell_notify -->|"registers sink"| node_windows_shell
node_shell_api -->|"calls COM"| node_windows_shell
node_switcher -->|"renders desktops"| node_desktop_model
node_switcher -->|"shows hover panel"| node_tooltip
node_switcher -.->|"reads marks"| node_marks
node_mark_sync -.->|"updates"| node_marks
node_mark_picker -.->|"edits marks"| node_marks
node_settings -->|"builds controls"| node_settings_controls
node_settings_controls -->|"edits settings"| node_config
node_controller -.->|"starts close-all"| node_close_run
node_close_run -->|"requests close"| node_window_closer
node_close_run -.->|"tracks windows"| node_window_inventory
node_close_run -->|"updates progress"| node_close_panel
node_controller -.->|"shows stats"| node_stats
node_controller -.->|"requests IP"| node_public_ip
node_user -->|"uses strip"| node_switcher
node_user -->|"configures"| node_settings

click node_program "https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Program.cs"
click node_controller "https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Controller.cs"
click node_installer "https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Installer.cs"
click node_config "https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Config.cs"
click node_desktop_service "https://github.com/markmodi279/desktopswitcher/blob/main/src/model/DesktopService.cs"
click node_desktop_model "https://github.com/markmodi279/desktopswitcher/blob/main/src/model/Desktop.cs"
click node_shell_api "https://github.com/markmodi279/desktopswitcher/blob/main/src/shell/VirtualDesktopApi.cs"
click node_shell_notify "https://github.com/markmodi279/desktopswitcher/blob/main/src/shell/VirtualDesktopNotify.cs"
click node_name_watcher "https://github.com/markmodi279/desktopswitcher/blob/main/src/shell/DesktopNameWatcher.cs"
click node_window_inventory "https://github.com/markmodi279/desktopswitcher/blob/main/src/model/WindowInventory.cs"
click node_window_closer "https://github.com/markmodi279/desktopswitcher/blob/main/src/model/WindowCloser.cs"
click node_close_run "https://github.com/markmodi279/desktopswitcher/blob/main/src/app/CloseAllRun.cs"
click node_close_panel "https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/CloseProgressWindow.cs"
click node_taskbar_host "https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/TaskbarHost.cs"
click node_switcher "https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/SwitcherStrip.cs"
click node_tooltip "https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/TooltipWindow.cs"
click node_settings "https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/SettingsWindow.cs"
click node_settings_controls "https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/SettingsControls.cs"
click node_marks "https://github.com/markmodi279/desktopswitcher/blob/main/src/app/MarkStore.cs"
click node_mark_sync "https://github.com/markmodi279/desktopswitcher/blob/main/src/app/MarkSync.cs"
click node_mark_picker "https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/MarkPicker.cs"
click node_stats "https://github.com/markmodi279/desktopswitcher/blob/main/src/model/SystemStats.cs"
click node_public_ip "https://github.com/markmodi279/desktopswitcher/blob/main/src/model/PublicIp.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_program,node_controller,node_installer,node_config,node_user toneBlue
class node_desktop_service,node_desktop_model,node_shell_api,node_shell_notify,node_name_watcher,node_window_inventory,node_window_closer toneAmber
class node_taskbar_host,node_switcher,node_tooltip,node_settings,node_settings_controls toneMint
class node_close_run,node_close_panel,node_marks,node_mark_sync,node_mark_picker,node_stats,node_public_ip toneRose
class node_windows_shell toneIndigo
```

## Components

### App lifecycle

- [Application entry](https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Program.cs): `src/app/Program.cs`
- [Controller](https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Controller.cs): `src/app/Controller.cs`
- [Install lifecycle](https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Installer.cs): `src/app/Installer.cs`
- [Configuration](https://github.com/markmodi279/desktopswitcher/blob/main/src/app/Config.cs): `src/app/Config.cs`

### Desktop management

- [Desktop service](https://github.com/markmodi279/desktopswitcher/blob/main/src/model/DesktopService.cs): `src/model/DesktopService.cs`
- [Desktop model](https://github.com/markmodi279/desktopswitcher/blob/main/src/model/Desktop.cs): `src/model/Desktop.cs`
- [Virtual desktop API](https://github.com/markmodi279/desktopswitcher/blob/main/src/shell/VirtualDesktopApi.cs): `src/shell/VirtualDesktopApi.cs`
- [Shell notifications](https://github.com/markmodi279/desktopswitcher/blob/main/src/shell/VirtualDesktopNotify.cs): `src/shell/VirtualDesktopNotify.cs`
- [Name watcher](https://github.com/markmodi279/desktopswitcher/blob/main/src/shell/DesktopNameWatcher.cs): `src/shell/DesktopNameWatcher.cs`
- [Window inventory](https://github.com/markmodi279/desktopswitcher/blob/main/src/model/WindowInventory.cs): `src/model/WindowInventory.cs`
- [Window closing](https://github.com/markmodi279/desktopswitcher/blob/main/src/model/WindowCloser.cs): `src/model/WindowCloser.cs`

### Taskbar interface

- [Taskbar host](https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/TaskbarHost.cs): `src/ui/TaskbarHost.cs`
- [Desktop strip](https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/SwitcherStrip.cs): `src/ui/SwitcherStrip.cs`
- [Desktop hover panel](https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/TooltipWindow.cs): `src/ui/TooltipWindow.cs`
- [Settings window](https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/SettingsWindow.cs): `src/ui/SettingsWindow.cs`
- [Setting controls](https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/SettingsControls.cs): `src/ui/SettingsControls.cs`

### User features

- [Close-all workflow](https://github.com/markmodi279/desktopswitcher/blob/main/src/app/CloseAllRun.cs): `src/app/CloseAllRun.cs`
- [Close progress panel](https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/CloseProgressWindow.cs): `src/ui/CloseProgressWindow.cs`
- [Desktop marks](https://github.com/markmodi279/desktopswitcher/blob/main/src/app/MarkStore.cs): `src/app/MarkStore.cs`
- [Mark synchronization](https://github.com/markmodi279/desktopswitcher/blob/main/src/app/MarkSync.cs): `src/app/MarkSync.cs`
- [Mark picker](https://github.com/markmodi279/desktopswitcher/blob/main/src/ui/MarkPicker.cs): `src/ui/MarkPicker.cs`
- [System statistics](https://github.com/markmodi279/desktopswitcher/blob/main/src/model/SystemStats.cs): `src/model/SystemStats.cs`
- [Public IP lookup](https://github.com/markmodi279/desktopswitcher/blob/main/src/model/PublicIp.cs): `src/model/PublicIp.cs`

### Other components

- **User**
- **Windows shell**

## Connections

- User → Application entry: launches
- Application entry → Controller: creates (evidence: `src/app/Program.cs`)
- Application entry → Install lifecycle: offers install (evidence: `src/app/Program.cs`)
- Application entry → Configuration: loads (evidence: `src/app/Program.cs`)
- Controller → Desktop service: uses
- Controller → Desktop strip: controls
- Controller → Taskbar host: docks
- Controller → Settings window: opens
- Desktop service → Virtual desktop API: queries and changes (evidence: `src/model/DesktopService.cs`)
- Desktop service → Shell notifications: registers notifications (evidence: `src/model/DesktopService.cs`)
- Desktop service → Name watcher: watches names (evidence: `src/model/DesktopService.cs`)
- Desktop service → Desktop model: builds model (evidence: `src/model/DesktopService.cs`)
- Shell notifications → Windows shell: registers sink (evidence: `src/shell/VirtualDesktopNotify.cs`)
- Virtual desktop API → Windows shell: calls COM (evidence: `src/shell/VirtualDesktopApi.cs`)
- Desktop strip → Desktop model: renders desktops (evidence: `src/ui/SwitcherStrip.cs`)
- Desktop strip → Desktop hover panel: shows hover panel (evidence: `src/ui/SwitcherStrip.cs`)
- Desktop strip → Desktop marks: reads marks
- Mark synchronization → Desktop marks: updates
- Mark picker → Desktop marks: edits marks
- Settings window → Setting controls: builds controls (evidence: `src/ui/SettingsWindow.cs`)
- Setting controls → Configuration: edits settings (evidence: `src/ui/SettingsControls.cs`)
- Controller → Close-all workflow: starts close-all
- Close-all workflow → Window closing: requests close (evidence: `src/app/CloseAllRun.cs`)
- Close-all workflow → Window inventory: tracks windows
- Close-all workflow → Close progress panel: updates progress (evidence: `src/app/CloseAllRun.cs`)
- Controller → System statistics: shows stats
- Controller → Public IP lookup: requests IP
- User → Desktop strip: uses strip
- User → Settings window: configures
