Skip to content

feat(working-with-fields): add 33 compiler-validated C# examples - Working With Fields [26.8.0/net8.0] - #89

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

feat(working-with-fields): add 33 compiler-validated C# examples - Working With Fields [26.8.0/net8.0]#89
amjad-sahi merged 40 commits into
mainfrom
feat/examples-working-with-fields-20260828

Conversation

@agent-aspose-diagram-examples

Copy link
Copy Markdown
Collaborator

Working With Fields — Compiler-Validated C# Examples

What this PR does

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

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-field-only-to-shapes-that-have-a-specific-custom-property-set-to-true.cs Add a field only to shapes that have a specific custom property set to true
assign-a-static-string-value-to-a-field-to-display-custom-text-on-the-shape.cs Assign a static string value to a field to display custom text on the shape
batch-remove-a-specific-field-from-every-shape-in-multiple-diagrams-located-in-a-shared-folder.cs Batch remove a specific field from every shape in multiple diagrams located in a shared folder
catch-exceptions-when-a-specified-field-does-not-exist-and-log-detailed-error-information.cs Catch exceptions when a specified field does not exist and log detailed error information
check-whether-a-field-already-exists-on-a-shape-before-attempting-to-create-a-duplicate-entry.cs Check whether a field already exists on a shape before attempting to create a duplicate entry
clone-an-existing-shape-and-copy-its-fields-to-the-new-shape-to-preserve-metadata.cs Clone an existing shape and copy its fields to the new shape to preserve metadata
create-a-field-whose-formula-references-another-shape-s-height-to-calculate-proportional-scaling.cs Create a field whose formula references another shape s height to calculate proportional scaling
delete-a-field-from-a-shape-using-its-index-position-within-the-fields-collection-for-precise-removal.cs Delete a field from a shape using its index position within the fields collection for precise removal
export-the-extracted-field-information-of-a-shape-to-a-json-file-for-external-analysis.cs Export the extracted field information of a shape to a json file for external analysis
export-the-updated-diagram-to-a-new-file-name-to-preserve-the-original-version-unchanged.cs Export the updated diagram to a new file name to preserve the original version unchanged
implement-try-catch-blocks-around-field-insertion-code-to-capture-and-log-any-runtime-errors.cs Implement try catch blocks around field insertion code to capture and log any runtime errors
insert-a-date-time-field-that-automatically-displays-the-current-system-timestamp-on-the-shape.cs Insert a date time field that automatically displays the current system timestamp on the shape
insert-a-field-into-a-shape-and-connect-it-to-another-shape-using-a-dynamic-connector.cs Insert a field into a shape and connect it to another shape using a dynamic connector
insert-a-field-into-a-shape-s-geometry-at-a-defined-coordinate-to-display-dynamic-text.cs Insert a field into a shape s geometry at a defined coordinate to display dynamic text
insert-a-field-into-a-shape-using-its-name-property-to-locate-the-target-element.cs Insert a field into a shape using its name property to locate the target element
insert-a-newly-created-custom-field-into-a-shape-identified-by-its-unique-id.cs Insert a newly created custom field into a shape identified by its unique id
iterate-over-all-shapes-in-the-diagram-and-add-a-timestamp-field-to-each-one.cs Iterate over all shapes in the diagram and add a timestamp field to each one
load-a-visio-diagram-from-a-file-path-and-access-a-specific-shape-by-id.cs Load a visio diagram from a file path and access a specific shape by id
log-each-field-operation-result-to-the-console-for-real-time-monitoring-during-development.cs Log each field operation result to the console for real time monitoring during development
loop-through-every-shape-and-update-an-existing-field-s-formula-only-if-the-shape-is-a-connector.cs Loop through every shape and update an existing field s formula only if the shape is a connector
measure-execution-time-of-batch-field-updates-to-evaluate-performance-improvements-after-code-optimization.cs Measure execution time of batch field updates to evaluate performance improvements after code optimization
perform-bulk-updates-of-field-formulas-across-several-diagrams-to-reflect-new-calculation-standards.cs Perform bulk updates of field formulas across several diagrams to reflect new calculation standards
process-all-visio-files-in-a-directory-adding-a-custom-field-to-each-shape-across-every-diagram.cs Process all visio files in a directory adding a custom field to each shape across every diagram
refresh-the-result-of-a-field-after-modifying-the-shape-s-geometry-to-ensure-accurate-values.cs Refresh the result of a field after modifying the shape s geometry to ensure accurate values
remove-a-field-from-a-shape-by-specifying-the-field-s-name-to-clean-up-unused-data.cs Remove a field from a shape by specifying the field s name to clean up unused data
remove-all-existing-fields-from-a-shape-before-adding-a-fresh-set-of-updated-fields.cs Remove all existing fields from a shape before adding a fresh set of updated fields
retrieve-the-list-of-field-names-and-their-data-types-from-a-given-shape-for-inspection.cs Retrieve the list of field names and their data types from a given shape for inspection
save-the-modified-visio-diagram-back-to-its-original-file-location-after-completing-field-operations.cs Save the modified visio diagram back to its original file location after completing field operations
set-the-formula-of-an-existing-field-to-calculate-the-shape-s-area-based-on-its-dimensions.cs Set the formula of an existing field to calculate the shape s area based on its dimensions
update-a-field-s-formula-to-reference-another-shape-s-data-for-dynamic-calculations.cs Update a field s formula to reference another shape s data for dynamic calculations
use-asynchronous-methods-to-load-a-visio-file-and-modify-fields-without-blocking-the-ui-thread.cs Use asynchronous methods to load a visio file and modify fields without blocking the ui thread
validate-field-results-after-modification-by-comparing-calculated-values-against-expected-thresholds.cs Validate field results after modification by comparing calculated values against expected thresholds
validate-that-a-field-s-formula-syntax-is-correct-before-applying-it-to-avoid-runtime-errors.cs Validate that a field s formula syntax is correct before applying it to avoid runtime errors

Validation Details


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

…-specific-custom-property-set-to-true

Task: Add a field only to shapes that have a specific custom property set to true

- 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-to-display-custom-text-on-the-shape

Task: Assign a static string value to a field to display custom text on the shape

- 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
…ry-shape-in-multiple-diagrams-located-in-a-shared-folder

Task: Batch remove a specific field from every shape in multiple diagrams located in a shared folder

- 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-does-not-exist-and-log-detailed-error-information

Task: Catch exceptions when a specified field does not exist and log detailed error information

- 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-a-shape-before-attempting-to-create-a-duplicate-entry

Task: Check whether a field already exists on a shape before attempting to create a duplicate entry

- 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
…ields-to-the-new-shape-to-preserve-metadata

Task: Clone an existing shape and copy its fields to the new shape to preserve metadata

- 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
…s-another-shape-s-height-to-calculate-proportional-scaling

Task: Create a field whose formula references another shape s height to calculate proportional scaling

- 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-position-within-the-fields-collection-for-precise-removal

Task: Delete a field from a shape using its index position within the fields collection for precise removal

- 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
…-of-a-shape-to-a-json-file-for-external-analysis

Task: Export the extracted field information of a shape to a json file for external analysis

- 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
…le-name-to-preserve-the-original-version-unchanged

Task: Export the updated diagram to a new file name to preserve the original version unchanged

- 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-insertion-code-to-capture-and-log-any-runtime-errors

Task: Implement try catch blocks around field insertion code to capture and log any runtime errors

- 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
…cally-displays-the-current-system-timestamp-on-the-shape

Task: Insert a date time field that automatically displays the current system timestamp on the shape

- 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-it-to-another-shape-using-a-dynamic-connector

Task: Insert a field into a shape and connect it to another shape using a dynamic connector

- 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
…-at-a-defined-coordinate-to-display-dynamic-text

Task: Insert a field into a shape s geometry at a defined coordinate to display dynamic text

- 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
…name-property-to-locate-the-target-element

Task: Insert a field into a shape using its name property to locate the target element

- 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-a-shape-identified-by-its-unique-id

Task: Insert a newly created custom field into a shape identified by its unique id

- 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-add-a-timestamp-field-to-each-one

Task: Iterate over all shapes in the diagram and add a timestamp field to each one

- 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-access-a-specific-shape-by-id

Task: Load a visio diagram from a file path and access a specific shape by id

- 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
…-console-for-real-time-monitoring-during-development

Task: Log each field operation result to the console for real time monitoring during development

- 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
…-existing-field-s-formula-only-if-the-shape-is-a-connector

Task: Loop through every shape and update an existing field s formula only if the shape is a connector

- 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
…updates-to-evaluate-performance-improvements-after-code-optimization

Task: Measure execution time of batch field updates to evaluate performance improvements after code optimization

- 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
…-across-several-diagrams-to-reflect-new-calculation-standards

Task: Perform bulk updates of field formulas across several diagrams to reflect new calculation standards

- 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
…-adding-a-custom-field-to-each-shape-across-every-diagram

Task: Process all visio files in a directory adding a custom field to each shape across every 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
…difying-the-shape-s-geometry-to-ensure-accurate-values

Task: Refresh the result of a field after modifying the shape s geometry to ensure accurate values

- 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
…ing-the-field-s-name-to-clean-up-unused-data

Task: Remove a field from a shape by specifying the field s name to clean up unused 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-before-adding-a-fresh-set-of-updated-fields

Task: Remove all existing fields from a shape before adding a fresh set of updated fields

- 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
…heir-data-types-from-a-given-shape-for-inspection

Task: Retrieve the list of field names and their data types from a given shape for inspection

- 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
…o-its-original-file-location-after-completing-field-operations

Task: Save the modified visio diagram back to its original file location after completing field operations

- 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
…o-calculate-the-shape-s-area-based-on-its-dimensions

Task: Set the formula of an existing field to calculate the shape s area based on its dimensions

- 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
…another-shape-s-data-for-dynamic-calculations

Task: Update a field s formula to reference another shape s data for dynamic calculations

- 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
…io-file-and-modify-fields-without-blocking-the-ui-thread

Task: Use asynchronous methods to load a visio file and modify fields without blocking the ui thread

- 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
…ion-by-comparing-calculated-values-against-expected-thresholds

Task: Validate field results after modification by comparing calculated values against expected thresholds

- 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
…-is-correct-before-applying-it-to-avoid-runtime-errors

Task: Validate that a field s formula syntax is correct before applying it to avoid runtime errors

- 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 c3c3b85 into main Aug 28, 2026
1 check passed
@amjad-sahi
amjad-sahi deleted the feat/examples-working-with-fields-20260828 branch August 28, 2026 16:04
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