Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Editor.ThemeSourceFileTransaction Class Reference

Commits a small set of theme source files with staging and rollback on failure. More...

Data Structures

class  Write
 Describes one validated write and its expected original contents. More...

Static Public Member Functions

static bool TryCommit (Write[] writes, out string error)
 Stages all files, checks originals, then commits or attempts rollback.

Static Private Member Functions

static void CheckOriginal (Write write)
static void TryDelete (string path)

Detailed Description

Commits a small set of theme source files with staging and rollback on failure.

Editor-only source-writing infrastructure. Each file is replaced atomically on supported filesystems; a set of files is not crash-atomic. Replacement checks expected source bytes, preventing silent overwrites after an external edit. No theme ownership is inferred here.

Member Function Documentation

◆ CheckOriginal()

void GWG.WindowFramework.Editor.ThemeSourceFileTransaction.CheckOriginal ( Write write)
inlinestaticprivate
Here is the caller graph for this function:

◆ TryCommit()

bool GWG.WindowFramework.Editor.ThemeSourceFileTransaction.TryCommit ( Write[] writes,
out string error )
inlinestatic

Stages all files, checks originals, then commits or attempts rollback.

Parameters
writesUnique destinations with previously validated source contents.
errorFailure and any recovery-file locations; null on success.
Returns
True when all source files were committed.

Preserves the UTF-8 BOM when present. Other encodings are rejected rather than corrupted. Failed rollback retains backups for manual recovery. Callers must not mutate asset metadata until this succeeds. Filesystem crashes and concurrent edits between the final check and replace remain limitations; source control is still recommended.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryDelete()

void GWG.WindowFramework.Editor.ThemeSourceFileTransaction.TryDelete ( string path)
inlinestaticprivate
Here is the caller graph for this function: