feat(working-with-themes): add 40 compiler-validated C# examples - Working With Themes [26.8.0/net8.0] - #103
Merged
Conversation
…me-s-color-palette-and-write-it-to-a-json-configuration-file Task: After applying a theme extract the theme s color palette and write it to a json configuration file - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…-to-shapes-on-a-page-based-on-their-layer-membership Task: Apply a different preset theme variant to shapes on a page based on their layer membership - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…-shapes-on-a-page-that-use-a-particular-master-style Task: Apply a preset theme quickstyle to all shapes on a page that use a particular master style - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…pes-filtered-by-their-geometry-type-such-as-rectangles-only Task: Apply a preset theme quickstyle to shapes filtered by their geometry type such as rectangles only - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…pes-selected-via-a-linq-query-based-on-their-text-content Task: Apply a preset theme quickstyle to shapes selected via a linq query based on their text content - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…atten-the-page-to-ensure-theme-persistence-in-exported-formats Task: Apply a preset theme to a page then flatten the page to ensure theme persistence in exported formats - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…f-its-current-theme-does-not-match-the-desired-preset Task: Apply a preset theme to a shape only if its current theme does not match the desired preset - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…t-share-a-specific-custom-property-value Task: Apply a preset theme to all shapes that share a specific custom property value - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…en-their-current-theme-matrix-differs-from-the-target-matrix Task: Apply a preset theme to shapes only when their current theme matrix differs from the target matrix - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…e-group-by-iterating-through-its-child-shapes-and-setting-each Task: Apply a preset theme variant to a shape group by iterating through its child shapes and setting each - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…e-only-if-the-shape-s-existing-theme-matrix-contains-a-color Task: Apply a preset theme variant to a shape only if the shape s existing theme matrix contains a color - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…lying-a-common-preset-theme-to-each-and-saving-results-concurrently Task: Batch process diagrams in parallel applying a common preset theme to each and saving results concurrently - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…-and-apply-them-to-another-page-within-the-same-diagram Task: Clone the theme settings from one page and apply them to another page within the same diagram - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…before-and-after-applying-a-quickstyle-to-verify-changes Task: Compare the theme settings of a shape before and after applying a quickstyle to verify changes - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…page-names-to-preset-themes-and-apply-them-programmatically Task: Create a configuration file that maps page names to preset themes and apply them programmatically - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…rences-from-a-database-and-applies-them-to-corresponding-diagram-pages Task: Create a script that reads theme preferences from a database and applies them to corresponding diagram pages - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…pe-s-presettheme-property-changes-after-applying-a-new-theme Task: Create a unit test that verifies a shape s presettheme property changes after applying a new theme - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…pect-the-visual-consistency-across-all-pages Task: Export a themed diagram to pdf and inspect the visual consistency across all pages - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…th-pdf-and-xps-formats-to-compare-rendering-fidelity Task: Export the diagram after theming to both pdf and xps formats to compare rendering fidelity - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…t-for-web-preview-after-applying-page-level-themes Task: Export the themed diagram to svg format for web preview after applying page level themes - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…-original-theme-and-the-new-preset-theme-after-modification Task: Generate a report listing each shape s original theme and the new preset theme after modification - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…ng-a-preset-theme-on-a-shape-that-may-be-locked Task: Implement a retry mechanism when setting a preset theme on a shape that may be locked - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…ptions-when-applying-a-theme-to-a-shape-lacking-style-data Task: Implement error handling to catch exceptions when applying a theme to a shape lacking style data - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…e-application-step-including-page-name-shape-id-and-applied-preset Task: Implement logging to capture each theme application step including page name shape id and applied preset - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…-and-assign-the-same-preset-theme-variant-to-each-page Task: Iterate through all pages in a diagram and assign the same preset theme variant to each page - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…-a-theme-variant-and-return-the-modified-byte-array Task: Load a diagram from a byte array apply a theme variant and return the modified byte array - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…me-settings-then-apply-a-fresh-preset-theme-to-standardize-appearance Task: Load a diagram remove all existing theme settings then apply a fresh preset theme to standardize appearance - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…y-a-preset-theme-to-its-first-page Task: Load a vsdx diagram from disk and apply a preset theme to its first page - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…-apply-a-uniform-preset-theme-and-save-them-back Task: Load multiple vsdx files from a folder apply a uniform preset theme and save them back - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…-a-preset-theme-to-a-large-diagram-with-thousands-of-shapes Task: Measure the execution time of applying a preset theme to a large diagram with thousands of shapes - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…e-default-value-to-remove-previously-applied-styling Task: Reset the presettheme of a shape to the default value to remove previously applied styling - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…t-from-each-shape-and-log-it-for-diagnostic-purposes Task: Retrieve the current presetthemevariant from each shape and log it for diagnostic purposes - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…a-memory-stream-for-further-processing-without-disk-i-o Task: Save a diagram with applied themes to a memory stream for further processing without disk i o - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…ific-shape-identified-by-its-id-to-change-its-appearance Task: Set the presettheme property on a specific shape identified by its id to change its appearance - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…pecific-preset-themes-and-apply-them-accordingly Task: Use a dictionary to map shape ids to specific preset themes and apply them accordingly - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…hemes-to-each-page-based-on-its-index-position Task: Use a loop to apply different preset themes to each page based on its index position - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…e-then-apply-a-preset-theme-to-its-pages-concurrently Task: Use asynchronous loading of a vsdx file then apply a preset theme to its pages concurrently - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…gn-a-custom-style-matrix-to-a-shape-for-advanced-formatting Task: Use setpresetthemestylematrics to assign a custom style matrix to a shape for advanced formatting - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…does-not-alter-shape-geometry-by-comparing-bounding-boxes-before-and-after Task: Validate that applying a preset theme does not alter shape geometry by comparing bounding boxes before and after - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
…-matches-the-expected-theme-by-comparing-theme-identifiers-after-saving Task: Validate that the applied preset theme matches the expected theme by comparing theme identifiers after saving - Validated: dotnet build passed - Validated: dotnet run passed - Generator: Aspose.Diagram Examples Generator Agent v2.0 - Library: Aspose.Diagram for .NET 26.8.0 - Framework: net8.0 - Pipeline: MCP retrieval → rules injection → LLM repair
… index and example table
…catalogue for Working With Themes category
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Working With Themes — Compiler-Validated C# Examples
What this PR does
Adds 40 AI-generated, compiler-validated C# examples for the Working With Themes category of Aspose.Diagram for .NET.
All examples were generated by the Aspose.Diagram Examples Generator Agent and passed the full three-attempt validation pipeline before being included.
Validation Summary
dotnet builddotnet runPipeline
Each example was generated and validated through:
Only examples that passed both
dotnet buildanddotnet runare included in this PR.Examples Added
after-applying-a-theme-extract-the-theme-s-color-palette-and-write-it-to-a-json-configuration-file.csapply-a-different-preset-theme-variant-to-shapes-on-a-page-based-on-their-layer-membership.csapply-a-preset-theme-quickstyle-to-all-shapes-on-a-page-that-use-a-particular-master-style.csapply-a-preset-theme-quickstyle-to-shapes-filtered-by-their-geometry-type-such-as-rectangles-only.csapply-a-preset-theme-quickstyle-to-shapes-selected-via-a-linq-query-based-on-their-text-content.csapply-a-preset-theme-to-a-page-then-flatten-the-page-to-ensure-theme-persistence-in-exported-formats.csapply-a-preset-theme-to-a-shape-only-if-its-current-theme-does-not-match-the-desired-preset.csapply-a-preset-theme-to-all-shapes-that-share-a-specific-custom-property-value.csapply-a-preset-theme-to-shapes-only-when-their-current-theme-matrix-differs-from-the-target-matrix.csapply-a-preset-theme-variant-to-a-shape-group-by-iterating-through-its-child-shapes-and-setting-each.csapply-a-preset-theme-variant-to-a-shape-only-if-the-shape-s-existing-theme-matrix-contains-a-color.csbatch-process-diagrams-in-parallel-applying-a-common-preset-theme-to-each-and-saving-results-concurrently.csclone-the-theme-settings-from-one-page-and-apply-them-to-another-page-within-the-same-diagram.cscompare-the-theme-settings-of-a-shape-before-and-after-applying-a-quickstyle-to-verify-changes.cscreate-a-configuration-file-that-maps-page-names-to-preset-themes-and-apply-them-programmatically.cscreate-a-script-that-reads-theme-preferences-from-a-database-and-applies-them-to-corresponding-diagram-pages.cscreate-a-unit-test-that-verifies-a-shape-s-presettheme-property-changes-after-applying-a-new-theme.csexport-a-themed-diagram-to-pdf-and-inspect-the-visual-consistency-across-all-pages.csexport-the-diagram-after-theming-to-both-pdf-and-xps-formats-to-compare-rendering-fidelity.csexport-the-themed-diagram-to-svg-format-for-web-preview-after-applying-page-level-themes.csgenerate-a-report-listing-each-shape-s-original-theme-and-the-new-preset-theme-after-modification.csimplement-a-retry-mechanism-when-setting-a-preset-theme-on-a-shape-that-may-be-locked.csimplement-error-handling-to-catch-exceptions-when-applying-a-theme-to-a-shape-lacking-style-data.csimplement-logging-to-capture-each-theme-application-step-including-page-name-shape-id-and-applied-preset.csiterate-through-all-pages-in-a-diagram-and-assign-the-same-preset-theme-variant-to-each-page.csload-a-diagram-from-a-byte-array-apply-a-theme-variant-and-return-the-modified-byte-array.csload-a-diagram-remove-all-existing-theme-settings-then-apply-a-fresh-preset-theme-to-standardize-appearance.csload-a-vsdx-diagram-from-disk-and-apply-a-preset-theme-to-its-first-page.csload-multiple-vsdx-files-from-a-folder-apply-a-uniform-preset-theme-and-save-them-back.csmeasure-the-execution-time-of-applying-a-preset-theme-to-a-large-diagram-with-thousands-of-shapes.csreset-the-presettheme-of-a-shape-to-the-default-value-to-remove-previously-applied-styling.csretrieve-the-current-presetthemevariant-from-each-shape-and-log-it-for-diagnostic-purposes.cssave-a-diagram-with-applied-themes-to-a-memory-stream-for-further-processing-without-disk-i-o.csset-the-presettheme-property-on-a-specific-shape-identified-by-its-id-to-change-its-appearance.csuse-a-dictionary-to-map-shape-ids-to-specific-preset-themes-and-apply-them-accordingly.csuse-a-loop-to-apply-different-preset-themes-to-each-page-based-on-its-index-position.csuse-asynchronous-loading-of-a-vsdx-file-then-apply-a-preset-theme-to-its-pages-concurrently.csuse-setpresetthemestylematrics-to-assign-a-custom-style-matrix-to-a-shape-for-advanced-formatting.csvalidate-that-applying-a-preset-theme-does-not-alter-shape-geometry-by-comparing-bounding-boxes-before-and-after.csvalidate-that-the-applied-preset-theme-matches-the-expected-theme-by-comparing-theme-identifiers-after-saving.csValidation Details
dotnet build— compiled without errors against Aspose.Diagram for .NET 26.8.0dotnet run— executed without unhandled exceptionsThis PR was created automatically by the Aspose.Diagram Examples Generator Agent. Merge after reviewing the examples above.