Commit 6ef54b6
Extract the custom editors that make screens lie about their types
A property rendered by a custom editor does not show the control its type
implies, and the business class says nothing about it. The same category of
hidden behaviour as the Model Editor -- and worse in one way: the editors live in
the platform project beside the module, so nobody reading the business objects
ever meets them.
Detected from [PropertyEditor], [ListEditor] and [ViewItem], and from editor base
types, which catches the abstract editor a team writes once and never decorates.
Alias constants are resolved across the whole solution, and that turned out to be
required rather than nice: the attribute reads
CustomEditorAliases.BarcodeScannerPropertyEditor, the constant is declared in the
module, and the editor sits in the platform project. Reading either project alone
resolves nothing and reports the expression verbatim, which leaks an
implementation detail where the reader needs the value XAF matches on.
The DevExpress documentation corrected a design mistake before it shipped. Its
second argument is not a flag about the editor, it is the blast radius:
isDefault: true replaces the default for that type everywhere, while false means
the editor is merely selectable in the Model Editor. Linking by type in both
cases listed every entity with a string property as "uses the barcode scanner",
which is exactly the confident wrongness this project exists to stop.
The same docs surfaced a mechanism that was missing entirely:
View.CustomizeViewItemControl<T>() reconfigures a built-in editor at run time.
There is no custom editor class to find and nothing on the entity records it -- a
screen simply behaves differently from what its business class says.
Client assets are recorded too: the JavaScript an editor cannot work without is
behaviour in neither C# nor XML, and it is why a control breaks when somebody
renames a file.
Verified against a real application, which found both of its editors, resolved
the alias across projects, and picked up the controller that customises a
built-in one. The demo fixture now mirrors that shape so the same paths are
covered by tests that need nobody's private code. 160 tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent fbfd59a commit 6ef54b6
17 files changed
Lines changed: 1163 additions & 0 deletions
File tree
- src
- XafLogicExplainer.Core
- Analyzers
- Generators
- Models
- XafLogicExplainer.Mcp/Tools
- tests/XafLogicExplainer.Tests
- Fixtures/DemoSolution/PharmacyDemo.Blazor.Server
- Controllers
- Editors
- wwwroot/js
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
12 | 39 | | |
13 | 40 | | |
14 | 41 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
314 | 315 | | |
315 | 316 | | |
316 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
317 | 350 | | |
318 | 351 | | |
319 | 352 | | |
| |||
0 commit comments