Skip to content

Feature/import export events#29

Merged
brandochn merged 2 commits intomainfrom
feature/import-export-events
Feb 28, 2026
Merged

Feature/import export events#29
brandochn merged 2 commits intomainfrom
feature/import-export-events

Conversation

@brandochn
Copy link
Copy Markdown
Owner

This pull request adds robust support for exporting and importing profiler events in JSON format within the WinForms application. It introduces a new service for event serialization, integrates export/import functionality into the UI, and ensures that event data is correctly extracted and restored to/from the grid. The changes improve usability by allowing users to save and reload profiling sessions, and they handle errors gracefully throughout the process.

Event Export/Import Functionality:

  • Added EventExportImportService to handle exporting events to JSON and importing them back, preserving row order and extracting column names while excluding metadata fields.
  • Implemented OnExportEvents and OnImportEvents handlers in MainPresenter to support exporting the current grid data to a JSON file and importing events from a JSON file, including dynamic column creation and error handling.

UI Integration:

  • Added "Export Events..." and "Import Events..." options to the File menu in the main view, and wired them to the new event handlers. [1] [2]
  • Updated the IMainView interface and its implementation to support new export/import events. [1] [2]

Data Extraction Helper:

  • Introduced DataGridViewHelper for extracting event data from DataGridView rows and columns, ensuring consistent serialization for export.

Wiring and Presenter Updates:

  • Registered the new export/import event handlers in the MainPresenter constructor and ensured grid state is managed correctly during import. [1] [2]

Add EventExportImportService for JSON export/import using metadata
__RowIndex and __Timestamp to preserve order. Add DataGridViewHelper to
serialize DataGridView rows to event dictionaries. Wire export/import
events into IMainView/MainView and reference helper from MainPresenter.
Add comprehensive EventExportImportService unit tests.
@brandochn brandochn merged commit 090614a into main Feb 28, 2026
1 check passed
@brandochn brandochn deleted the feature/import-export-events branch February 28, 2026 23:22
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.

1 participant