Skip to content

feat(working-with-layers): add 30 compiler-validated C# examples - Working With Layers [26.8.0/net8.0] - #94

Merged
amjad-sahi merged 37 commits into
mainfrom
feat/examples-working-with-layers-20260828
Aug 28, 2026
Merged

feat(working-with-layers): add 30 compiler-validated C# examples - Working With Layers [26.8.0/net8.0]#94
amjad-sahi merged 37 commits into
mainfrom
feat/examples-working-with-layers-20260828

Conversation

@agent-aspose-diagram-examples

Copy link
Copy Markdown
Collaborator

Working With Layers — Compiler-Validated C# Examples

What this PR does

Adds 30 AI-generated, compiler-validated C# examples for the Working With Layers 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

Check Result
dotnet build ✅ Passed — zero compiler errors
dotnet run ✅ Passed — clean execution
Aspose.Diagram Version 26.8.0
Target Framework net8.0
Examples Added 30

Pipeline

Each example was generated and validated through:

  1. Attempt 1 — MCP direct code retrieval and assembly
  2. Attempt 2 — MCP retrieval with injected API correction rules
  3. Attempt 3 — LLM repair pass with compiler errors and rules

Only examples that passed both dotnet build and dotnet run are included in this PR.

Examples Added

File Task Description
add-a-custom-tag-to-the-legal-layer-and-retrieve-it-during-runtime-for-compliance-checks.cs Add a custom tag to the legal layer and retrieve it during runtime for compliance checks
add-a-new-layer-named-annotations-to-an-existing-diagram-and-set-its-color-to-blue.cs Add a new layer named annotations to an existing diagram and set its color to blue
apply-a-custom-metadata-property-to-the-security-layer-for-downstream-processing.cs Apply a custom metadata property to the security layer for downstream processing
apply-a-drop-shadow-effect-to-every-shape-within-the-ui-layer-using-layer-settings.cs Apply a drop shadow effect to every shape within the ui layer using layer settings
change-the-fill-color-of-all-shapes-in-the-marketing-layer-to-light-gray.cs Change the fill color of all shapes in the marketing layer to light gray
clone-the-draft-layer-rename-the-clone-to-final-and-preserve-its-shape-properties.cs Clone the draft layer rename the clone to final and preserve its shape properties
copy-all-shapes-from-the-design-layer-into-a-newly-created-layer-called-prototype.cs Copy all shapes from the design layer into a newly created layer called prototype
create-a-new-diagram-that-contains-only-the-shapes-from-the-export-layer-of-an-existing-file.cs Create a new diagram that contains only the shapes from the export layer of an existing file
create-a-snapshot-image-of-the-diagram-with-only-the-presentation-layer-visible.cs Create a snapshot image of the diagram with only the presentation layer visible
delete-the-layer-obsolete-and-permanently-remove-its-associated-shapes-from-the-diagram.cs Delete the layer obsolete and permanently remove its associated shapes from the diagram
detect-and-remove-any-orphaned-shapes-that-are-not-assigned-to-any-layer.cs Detect and remove any orphaned shapes that are not assigned to any layer
export-a-diagram-showing-only-the-visible-layers-to-a-vdx-file-for-legacy-compatibility.cs Export a diagram showing only the visible layers to a vdx file for legacy compatibility
export-a-diagram-with-only-the-technical-layer-visible-to-an-svg-file-for-web-display.cs Export a diagram with only the technical layer visible to an svg file for web display
export-the-list-of-layers-and-their-associated-shape-counts-to-a-json-file.cs Export the list of layers and their associated shape counts to a json file
filter-shapes-by-layer-and-export-only-those-from-the-analysis-layer-to-a-csv-report.cs Filter shapes by layer and export only those from the analysis layer to a csv report
generate-a-summary-report-listing-each-layer-s-name-visibility-and-total-shape-count.cs Generate a summary report listing each layer s name visibility and total shape count
iterate-over-layers-and-export-each-visible-layer-as-an-individual-pdf-document.cs Iterate over layers and export each visible layer as an individual pdf document
iterate-through-each-layer-and-count-the-number-of-connector-shapes-it-contains.cs Iterate through each layer and count the number of connector shapes it contains
load-a-diagram-disable-the-grid-layer-and-save-the-result-as-a-vsdx-file.cs Load a diagram disable the grid layer and save the result as a vsdx file
load-a-diagram-lock-the-architecture-layer-to-prevent-edits-and-save-the-locked-state.cs Load a diagram lock the architecture layer to prevent edits and save the locked state
load-a-visio-diagram-and-list-all-layer-names-with-their-visibility-status.cs Load a visio diagram and list all layer names with their visibility status
load-multiple-visio-files-from-a-folder-merge-their-overview-layers-into-a-single-diagram.cs Load multiple visio files from a folder merge their overview layers into a single diagram
merge-the-draft-and-review-layers-into-a-single-layer-while-preserving-shape-order.cs Merge the draft and review layers into a single layer while preserving shape order
programmatically-reorder-layers-so-that-background-appears-beneath-all-other-layers-in-the-stack.cs Programmatically reorder layers so that background appears beneath all other layers in the stack
rename-the-layer-background-to-base-and-update-all-shapes-referencing-the-old-name.cs Rename the layer background to base and update all shapes referencing the old name
set-the-line-weight-of-the-infrastructure-layer-to-2-points-for-all-its-shapes.cs Set the line weight of the infrastructure layer to 2 points for all its shapes
set-the-print-visibility-of-the-confidential-layer-to-false-before-generating-a-print-ready-pdf.cs Set the print visibility of the confidential layer to false before generating a print ready pdf
set-the-transparency-of-the-watermark-layer-to-50-percent-for-all-its-shapes.cs Set the transparency of the watermark layer to 50 percent for all its shapes
toggle-visibility-of-the-details-layer-to-hidden-before-exporting-the-diagram-to-pdf.cs Toggle visibility of the details layer to hidden before exporting the diagram to pdf
validate-that-each-layer-in-a-diagram-has-a-unique-name-and-report-duplicates.cs Validate that each layer in a diagram has a unique name and report duplicates

Validation Details


This PR was created automatically by the Aspose.Diagram Examples Generator Agent. Merge after reviewing the examples above.

…d-retrieve-it-during-runtime-for-compliance-checks

Task: Add a custom tag to the legal layer and retrieve it during runtime for compliance checks

- 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
…n-existing-diagram-and-set-its-color-to-blue

Task: Add a new layer named annotations to an existing diagram and set its color to blue

- 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-security-layer-for-downstream-processing

Task: Apply a custom metadata property to the security layer for downstream processing

- 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
…ape-within-the-ui-layer-using-layer-settings

Task: Apply a drop shadow effect to every shape within the ui layer using layer settings

- 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
…-the-marketing-layer-to-light-gray

Task: Change the fill color of all shapes in the marketing layer to light gray

- 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-final-and-preserve-its-shape-properties

Task: Clone the draft layer rename the clone to final and preserve its shape properties

- 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
…into-a-newly-created-layer-called-prototype

Task: Copy all shapes from the design layer into a newly created layer called prototype

- 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-the-shapes-from-the-export-layer-of-an-existing-file

Task: Create a new diagram that contains only the shapes from the export layer of an existing 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
…-with-only-the-presentation-layer-visible

Task: Create a snapshot image of the diagram with only the presentation layer visible

- 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
…tly-remove-its-associated-shapes-from-the-diagram

Task: Delete the layer obsolete and permanently remove its associated shapes from the 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
…that-are-not-assigned-to-any-layer

Task: Detect and remove any orphaned shapes that are not assigned to any layer

- 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
…ble-layers-to-a-vdx-file-for-legacy-compatibility

Task: Export a diagram showing only the visible layers to a vdx file for legacy compatibility

- 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
…al-layer-visible-to-an-svg-file-for-web-display

Task: Export a diagram with only the technical layer visible to an svg file for web display

- 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
…sociated-shape-counts-to-a-json-file

Task: Export the list of layers and their associated shape counts to a json 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
…-those-from-the-analysis-layer-to-a-csv-report

Task: Filter shapes by layer and export only those from the analysis layer to a csv report

- 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
…-layer-s-name-visibility-and-total-shape-count

Task: Generate a summary report listing each layer s name visibility and total shape count

- 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
…sible-layer-as-an-individual-pdf-document

Task: Iterate over layers and export each visible layer as an individual pdf document

- 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
…he-number-of-connector-shapes-it-contains

Task: Iterate through each layer and count the number of connector shapes it contains

- 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-save-the-result-as-a-vsdx-file

Task: Load a diagram disable the grid layer and save the result as a vsdx 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
…ayer-to-prevent-edits-and-save-the-locked-state

Task: Load a diagram lock the architecture layer to prevent edits and save the locked state

- 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
…r-names-with-their-visibility-status

Task: Load a visio diagram and list all layer names with their visibility status

- 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
…r-merge-their-overview-layers-into-a-single-diagram

Task: Load multiple visio files from a folder merge their overview layers into a single 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
…-a-single-layer-while-preserving-shape-order

Task: Merge the draft and review layers into a single layer while preserving shape order

- 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-background-appears-beneath-all-other-layers-in-the-stack

Task: Programmatically reorder layers so that background appears beneath all other layers in the stack

- 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
…d-update-all-shapes-referencing-the-old-name

Task: Rename the layer background to base and update all shapes referencing the old name

- 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
…ure-layer-to-2-points-for-all-its-shapes

Task: Set the line weight of the infrastructure layer to 2 points for all its 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
…ential-layer-to-false-before-generating-a-print-ready-pdf

Task: Set the print visibility of the confidential layer to false before generating a print ready pdf

- 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
…layer-to-50-percent-for-all-its-shapes

Task: Set the transparency of the watermark layer to 50 percent for all its 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
…-to-hidden-before-exporting-the-diagram-to-pdf

Task: Toggle visibility of the details layer to hidden before exporting the diagram to pdf

- 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
…has-a-unique-name-and-report-duplicates

Task: Validate that each layer in a diagram has a unique name and report duplicates

- 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
@amjad-sahi
amjad-sahi merged commit 6c35b34 into main Aug 28, 2026
1 check passed
@amjad-sahi
amjad-sahi deleted the feat/examples-working-with-layers-20260828 branch August 28, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants