Commit fa5594f
committed
Feature:
Fixes #62
Add `InitializeComponentAttribute` feature to the project.
* **Attribute Class**: Add `InitializeComponentAttribute` class in `src/core/Riverside.Extensions.WinUI/InitializeComponentAttribute.cs`.
- Define `InitializeComponentAttribute` partial class in `Riverside.Extensions.WinUI` namespace.
- Mark the class with `[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]`.
- Add a constructor to the class.
* **Source Generator**: Add source generator for `InitializeComponentAttribute` in `src/core/Riverside.Extensions.WinUI/InitializeComponentAttribute.SourceGenerator.cs`.
- Define `InitializeComponentGenerator` partial class in `Riverside.Extensions.WinUI` namespace.
- Implement `ISourceGenerator` interface.
- Implement `Initialize` method.
- Implement `Execute` method to generate the constructor with `this.InitializeComponent()` for classes with `InitializeComponentAttribute`.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/RiversideValley/Toolkit/issues/62?shareId=XXXX-XXXX-XXXX-XXXX).InitializeComponentAttribute
1 parent 01e6b72 commit fa5594f
File tree
2 files changed
+62
-0
lines changed- src/core/Riverside.Extensions.WinUI
2 files changed
+62
-0
lines changedLines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 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 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments