Skip to content

Conversation

breyed
Copy link
Contributor

@breyed breyed commented Aug 27, 2025

For .NET 9 (and perhap earlier versions), events from SubscribeToEvents passed incorrect parameters. For example, a null string was becoming a quotation mark. To fix it, I replaced the existing array marshalling workaround with an ArrayList. It's also less code and probably faster.

@Copilot Copilot AI review requested due to automatic review settings August 27, 2025 16:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes event parameter marshalling issues on .NET 9 where certain parameter types (like null strings) were being incorrectly converted. The fix replaces an array-based workaround with ArrayList to properly handle parameter serialization.

  • Replaces object[] with ArrayList for event parameters in C# code
  • Simplifies parameter iteration logic in FoxPro code by directly accessing ArrayList items
  • Adds null check for handler object to prevent errors when unsubscribed

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
DotnetBridge/Utilities/EventSubscriber.cs Changes RaisedEvent.Params from object[] to ArrayList and updates parameter creation logic
Distribution/wwDotnetBridge.PRG Simplifies parameter handling by directly accessing ArrayList items instead of creating dynamic properties

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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