feat(working-with-fields): add 33 compiler-validated C# examples - Working With Fields [26.8.0/net8.0] - #89
Merged
Conversation
…-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
… index and example table
…catalogue for Working With Fields 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 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
dotnet builddotnet runPipeline
Each example was generated and validated through:
Only examples that passed both
dotnet buildanddotnet runare included in this PR.Examples Added
add-a-field-only-to-shapes-that-have-a-specific-custom-property-set-to-true.csassign-a-static-string-value-to-a-field-to-display-custom-text-on-the-shape.csbatch-remove-a-specific-field-from-every-shape-in-multiple-diagrams-located-in-a-shared-folder.cscatch-exceptions-when-a-specified-field-does-not-exist-and-log-detailed-error-information.cscheck-whether-a-field-already-exists-on-a-shape-before-attempting-to-create-a-duplicate-entry.csclone-an-existing-shape-and-copy-its-fields-to-the-new-shape-to-preserve-metadata.cscreate-a-field-whose-formula-references-another-shape-s-height-to-calculate-proportional-scaling.csdelete-a-field-from-a-shape-using-its-index-position-within-the-fields-collection-for-precise-removal.csexport-the-extracted-field-information-of-a-shape-to-a-json-file-for-external-analysis.csexport-the-updated-diagram-to-a-new-file-name-to-preserve-the-original-version-unchanged.csimplement-try-catch-blocks-around-field-insertion-code-to-capture-and-log-any-runtime-errors.csinsert-a-date-time-field-that-automatically-displays-the-current-system-timestamp-on-the-shape.csinsert-a-field-into-a-shape-and-connect-it-to-another-shape-using-a-dynamic-connector.csinsert-a-field-into-a-shape-s-geometry-at-a-defined-coordinate-to-display-dynamic-text.csinsert-a-field-into-a-shape-using-its-name-property-to-locate-the-target-element.csinsert-a-newly-created-custom-field-into-a-shape-identified-by-its-unique-id.csiterate-over-all-shapes-in-the-diagram-and-add-a-timestamp-field-to-each-one.csload-a-visio-diagram-from-a-file-path-and-access-a-specific-shape-by-id.cslog-each-field-operation-result-to-the-console-for-real-time-monitoring-during-development.csloop-through-every-shape-and-update-an-existing-field-s-formula-only-if-the-shape-is-a-connector.csmeasure-execution-time-of-batch-field-updates-to-evaluate-performance-improvements-after-code-optimization.csperform-bulk-updates-of-field-formulas-across-several-diagrams-to-reflect-new-calculation-standards.csprocess-all-visio-files-in-a-directory-adding-a-custom-field-to-each-shape-across-every-diagram.csrefresh-the-result-of-a-field-after-modifying-the-shape-s-geometry-to-ensure-accurate-values.csremove-a-field-from-a-shape-by-specifying-the-field-s-name-to-clean-up-unused-data.csremove-all-existing-fields-from-a-shape-before-adding-a-fresh-set-of-updated-fields.csretrieve-the-list-of-field-names-and-their-data-types-from-a-given-shape-for-inspection.cssave-the-modified-visio-diagram-back-to-its-original-file-location-after-completing-field-operations.csset-the-formula-of-an-existing-field-to-calculate-the-shape-s-area-based-on-its-dimensions.csupdate-a-field-s-formula-to-reference-another-shape-s-data-for-dynamic-calculations.csuse-asynchronous-methods-to-load-a-visio-file-and-modify-fields-without-blocking-the-ui-thread.csvalidate-field-results-after-modification-by-comparing-calculated-values-against-expected-thresholds.csvalidate-that-a-field-s-formula-syntax-is-correct-before-applying-it-to-avoid-runtime-errors.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.