Skip to content

Pass isEnumerator value to OnCreateProxyShareEventArgs - #525

Open
NopeCharon wants to merge 1 commit into
NetOfficeFw:mainfrom
NopeCharon:bugfix/482-proxy_share_isenumerator
Open

NopeCharon wants to merge 1 commit into
NetOfficeFw:mainfrom
NopeCharon:bugfix/482-proxy_share_isenumerator

Conversation

@NopeCharon

Copy link
Copy Markdown

Why

Core.OnCreateProxyShareEventArgs assigned its IsEnumerator property to itself instead of the isEnumerator constructor argument. Every Core.CreateProxyShare event handler saw false, even when Core.CreateNewProxyShare() was called for an enumerator proxy. A custom handler therefore could not create a COMProxyShare with the enumerator release behavior.

Changes

  • Store the isEnumerator constructor argument in OnCreateProxyShareEventArgs.
  • Add CoreTests, which raises the CreateProxyShare event through Core.CreateNewProxyShare() for both values and checks what the handler sees. The test uses FakeComObject and doesn't need Office.
  • Add a Fixed changelog entry under v2.0.0-preview.

Verification

  • Without the fix, the isEnumerator: true case fails (Expected: True But was: False). With the fix, both cases pass.

Fixes #482

The `OnCreateProxyShareEventArgs` constructor assigned the `IsEnumerator`
property to itself instead of storing the `isEnumerator` argument. As a
result, every `Core.CreateProxyShare` event handler observed `false`, even
when `Core.CreateNewProxyShare()` was called for an enumerator proxy, and
a custom handler could not create a `COMProxyShare` with the enumerator
release behavior.

Store the constructor argument and add a unit test which raises the
`CreateProxyShare` event through `Core.CreateNewProxyShare()` and checks
the value observed by the event handler.

Fixes NetOfficeFw#482
@jozefizso jozefizso added this to the 1.9.13 milestone Oct 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

OnCreateProxyShareEventArgs loses isEnumerator value

2 participants