Skip to content

feat(working-with-comments): add 35 compiler-validated C# examples - Working With Comments [26.8.0/net8.0] - #85

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

feat(working-with-comments): add 35 compiler-validated C# examples - Working With Comments [26.8.0/net8.0]#85
amjad-sahi merged 40 commits into
mainfrom
feat/examples-working-with-comments-20260828

Conversation

@agent-aspose-diagram-examples

Copy link
Copy Markdown
Collaborator

Working With Comments — Compiler-Validated C# Examples

What this PR does

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

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-reply-to-an-existing-comment-thread-preserving-the-original-hierarchy-and-metadata.cs Add a reply to an existing comment thread preserving the original hierarchy and metadata
add-timestamps-to-comments-automatically-when-they-are-created-using-the-system-s-current-time-zone.cs Add timestamps to comments automatically when they are created using the system s current time zone
apply-a-conditional-formatting-rule-that-changes-comment-background-color-based-on-author-role.cs Apply a conditional formatting rule that changes comment background color based on author role
apply-a-custom-tag-to-comments-that-meet-certain-criteria-enabling-later-filtered-searches.cs Apply a custom tag to comments that meet certain criteria enabling later filtered searches
copy-comments-from-one-diagram-to-another-preserving-their-original-author-and-creation-dates.cs Copy comments from one diagram to another preserving their original author and creation dates
create-a-custom-comment-style-with-specific-font-and-background-color-then-apply-it-to-selected-comments.cs Create a custom comment style with specific font and background color then apply it to selected comments
create-a-macro-that-removes-all-comments-older-than-a-specified-number-of-days-from-a-diagram.cs Create a macro that removes all comments older than a specified number of days from a diagram
create-a-report-that-groups-comments-by-shape-type-and-counts-occurrences-per-group.cs Create a report that groups comments by shape type and counts occurrences per group
create-a-utility-that-lists-comment-authors-alphabetically-and-outputs-the-list-to-a-text-file.cs Create a utility that lists comment authors alphabetically and outputs the list to a text file
delete-comments-containing-a-specific-keyword-and-verify-the-diagram-no-longer-displays-them.cs Delete comments containing a specific keyword and verify the diagram no longer displays them
detect-overlapping-comment-positions-and-automatically-adjust-their-coordinates-to-avoid-visual-clutter.cs Detect overlapping comment positions and automatically adjust their coordinates to avoid visual clutter
develop-a-script-to-migrate-comments-from-legacy-diagram-files-to-the-latest-file-format-version.cs Develop a script to migrate comments from legacy diagram files to the latest file format version
export-all-diagram-comments-to-a-json-file-including-position-coordinates-and-linked-shape-identifiers.cs Export all diagram comments to a json file including position coordinates and linked shape identifiers
export-comment-data-to-an-html-file-formatting-each-comment-as-a-collapsible-section-with-metadata.cs Export comment data to an html file formatting each comment as a collapsible section with metadata
export-comment-metadata-to-a-relational-database-mapping-each-comment-to-its-associated-shape-id.cs Export comment metadata to a relational database mapping each comment to its associated shape id
extract-comment-text-and-embed-it-as-hidden-metadata-within-the-diagram-file-for-later-retrieval.cs Extract comment text and embed it as hidden metadata within the diagram file for later retrieval
filter-comments-by-creation-date-range-and-export-the-filtered-set-to-a-plain-text-log-file.cs Filter comments by creation date range and export the filtered set to a plain text log file
generate-a-pdf-snapshot-of-a-diagram-with-comments-rendered-as-callout-annotations.cs Generate a pdf snapshot of a diagram with comments rendered as callout annotations
generate-a-summary-table-listing-comment-counts-per-page-and-save-it-as-an-excel-worksheet.cs Generate a summary table listing comment counts per page and save it as an excel worksheet
implement-a-feature-to-lock-comments-preventing-further-edits-unless-a-specific-unlock-flag-is-set.cs Implement a feature to lock comments preventing further edits unless a specific unlock flag is set
implement-batch-processing-to-add-a-standardized-disclaimer-comment-to-every-diagram-in-a-project-directory.cs Implement batch processing to add a standardized disclaimer comment to every diagram in a project directory
implement-error-handling-to-gracefully-skip-diagrams-that-lack-comment-support-during-batch-operations.cs Implement error handling to gracefully skip diagrams that lack comment support during batch operations
import-comments-from-an-xml-document-assigning-them-to-corresponding-shapes-based-on-matching-ids.cs Import comments from an xml document assigning them to corresponding shapes based on matching ids
iterate-through-multiple-visio-files-in-a-folder-extracting-comment-timestamps-into-a-consolidated-report.cs Iterate through multiple visio files in a folder extracting comment timestamps into a consolidated report
load-a-diagram-enumerate-comment-ids-and-use-them-to-retrieve-detailed-comment-objects-via-api.cs Load a diagram enumerate comment ids and use them to retrieve detailed comment objects via api
load-a-visio-diagram-add-a-new-comment-to-a-specific-shape-then-save-the-file.cs Load a visio diagram add a new comment to a specific shape then save the file
programmatically-attach-a-comment-to-a-connector-shape-specifying-the-exact-segment-where-it-appears.cs Programmatically attach a comment to a connector shape specifying the exact segment where it appears
read-comments-from-a-diagram-translate-their-text-using-an-external-service-and-update-them-in-place.cs Read comments from a diagram translate their text using an external service and update them in place
retrieve-all-comments-from-a-diagram-and-export-their-text-and-author-information-to-a-csv-file.cs Retrieve all comments from a diagram and export their text and author information to a csv file
search-for-comments-authored-by-a-particular-user-and-highlight-the-associated-shapes-in-the-diagram.cs Search for comments authored by a particular user and highlight the associated shapes in the diagram
set-the-visibility-flag-of-all-comments-to-false-then-render-the-diagram-without-comment-overlays.cs Set the visibility flag of all comments to false then render the diagram without comment overlays
synchronize-comment-visibility-settings-across-multiple-diagrams-to-ensure-consistent-presentation-during-stakeholder-re.cs Synchronize comment visibility settings across multiple diagrams to ensure consistent presentation during stakeholder re
update-author-names-of-existing-comments-using-a-provided-mapping-dictionary-then-save-the-changes.cs Update author names of existing comments using a provided mapping dictionary then save the changes
validate-that-comment-positions-stay-within-page-boundaries-after-diagram-scaling-operations.cs Validate that comment positions stay within page boundaries after diagram scaling operations
validate-that-each-comment-contains-non-empty-text-and-report-any-violations-as-warnings.cs Validate that each comment contains non empty text and report any violations as warnings

Validation Details


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

…hread-preserving-the-original-hierarchy-and-metadata

Task: Add a reply to an existing comment thread preserving the original hierarchy and 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
…ally-when-they-are-created-using-the-system-s-current-time-zone

Task: Add timestamps to comments automatically when they are created using the system s current time zone

- 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-changes-comment-background-color-based-on-author-role

Task: Apply a conditional formatting rule that changes comment background color based on author role

- 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
…meet-certain-criteria-enabling-later-filtered-searches

Task: Apply a custom tag to comments that meet certain criteria enabling later filtered searches

- 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
…other-preserving-their-original-author-and-creation-dates

Task: Copy comments from one diagram to another preserving their original author and creation dates

- 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-font-and-background-color-then-apply-it-to-selected-comments

Task: Create a custom comment style with specific font and background color then apply it to selected comments

- 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
…ents-older-than-a-specified-number-of-days-from-a-diagram

Task: Create a macro that removes all comments older than a specified number of days from a 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
…-by-shape-type-and-counts-occurrences-per-group

Task: Create a report that groups comments by shape type and counts occurrences per group

- 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
…authors-alphabetically-and-outputs-the-list-to-a-text-file

Task: Create a utility that lists comment authors alphabetically and outputs the list to a text 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
…c-keyword-and-verify-the-diagram-no-longer-displays-them

Task: Delete comments containing a specific keyword and verify the diagram no longer displays them

- 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-automatically-adjust-their-coordinates-to-avoid-visual-clutter

Task: Detect overlapping comment positions and automatically adjust their coordinates to avoid visual clutter

- 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
…-from-legacy-diagram-files-to-the-latest-file-format-version

Task: Develop a script to migrate comments from legacy diagram files to the latest file format version

- 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-file-including-position-coordinates-and-linked-shape-identifiers

Task: Export all diagram comments to a json file including position coordinates and linked shape identifiers

- 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
…formatting-each-comment-as-a-collapsible-section-with-metadata

Task: Export comment data to an html file formatting each comment as a collapsible section with 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
…nal-database-mapping-each-comment-to-its-associated-shape-id

Task: Export comment metadata to a relational database mapping each comment to its associated shape 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
…-hidden-metadata-within-the-diagram-file-for-later-retrieval

Task: Extract comment text and embed it as hidden metadata within the diagram file for later retrieval

- 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
…ge-and-export-the-filtered-set-to-a-plain-text-log-file

Task: Filter comments by creation date range and export the filtered set to a plain text log 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-comments-rendered-as-callout-annotations

Task: Generate a pdf snapshot of a diagram with comments rendered as callout annotations

- 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
…ment-counts-per-page-and-save-it-as-an-excel-worksheet

Task: Generate a summary table listing comment counts per page and save it as an excel worksheet

- 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
…-preventing-further-edits-unless-a-specific-unlock-flag-is-set

Task: Implement a feature to lock comments preventing further edits unless a specific unlock flag is set

- 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
…standardized-disclaimer-comment-to-every-diagram-in-a-project-directory

Task: Implement batch processing to add a standardized disclaimer comment to every diagram in a project directory

- 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
…ly-skip-diagrams-that-lack-comment-support-during-batch-operations

Task: Implement error handling to gracefully skip diagrams that lack comment support during batch 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
…-assigning-them-to-corresponding-shapes-based-on-matching-ids

Task: Import comments from an xml document assigning them to corresponding shapes based on matching ids

- 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
…-in-a-folder-extracting-comment-timestamps-into-a-consolidated-report

Task: Iterate through multiple visio files in a folder extracting comment timestamps into a consolidated 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
…-and-use-them-to-retrieve-detailed-comment-objects-via-api

Task: Load a diagram enumerate comment ids and use them to retrieve detailed comment objects via api

- 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
…nt-to-a-specific-shape-then-save-the-file

Task: Load a visio diagram add a new comment to a specific shape then save the 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
…-a-connector-shape-specifying-the-exact-segment-where-it-appears

Task: Programmatically attach a comment to a connector shape specifying the exact segment where it appears

- 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
…te-their-text-using-an-external-service-and-update-them-in-place

Task: Read comments from a diagram translate their text using an external service and update them in place

- 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-export-their-text-and-author-information-to-a-csv-file

Task: Retrieve all comments from a diagram and export their text and author information to a csv 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
…rticular-user-and-highlight-the-associated-shapes-in-the-diagram

Task: Search for comments authored by a particular user and highlight the associated shapes in 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
…nts-to-false-then-render-the-diagram-without-comment-overlays

Task: Set the visibility flag of all comments to false then render the diagram without comment overlays

- 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
…ngs-across-multiple-diagrams-to-ensure-consistent-presentation-during-stakeholder-re

Task: Synchronize comment visibility settings across multiple diagrams to ensure consistent presentation during stakeholder re

- 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
…ents-using-a-provided-mapping-dictionary-then-save-the-changes

Task: Update author names of existing comments using a provided mapping dictionary then save the 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
…-within-page-boundaries-after-diagram-scaling-operations

Task: Validate that comment positions stay within page boundaries after diagram scaling 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
…non-empty-text-and-report-any-violations-as-warnings

Task: Validate that each comment contains non empty text and report any violations as warnings

- 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 f984377 into main Aug 28, 2026
1 check passed
@amjad-sahi
amjad-sahi deleted the feat/examples-working-with-comments-20260828 branch August 28, 2026 15:18
@amjad-sahi
amjad-sahi restored the feat/examples-working-with-comments-20260828 branch August 28, 2026 15:27
@amjad-sahi
amjad-sahi deleted the feat/examples-working-with-comments-20260828 branch August 28, 2026 15:28
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