Skip to content

Document whether adding same delegate multiple times will also invoke it multiple times #51930

@cseas

Description

@cseas

Type of issue

Missing information

Description

For example, from the linked documentation, what happens if we add hiDel twice?

multiDel += hiDel;
multiDel += hiDel;

Will it invoke hiDel twice or will the second line become a no-op since it's the same delegate?
And if it registers it twice, when we do multiDel -= hiDel, which one does it remove?

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/delegates/how-to-combine-delegates-multicast-delegates

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/programming-guide/delegates/how-to-combine-delegates-multicast-delegates.md

Document Version Independent Id

bf824660-4403-8c20-d376-ebf166a995f1

Platform Id

1af2302f-417d-f9cf-379a-3e4c647aef23

Article author

@BillWagner

Metadata

  • ID: 68b46f47-d79e-f970-3aa5-5145c243972c
  • PlatformId: 1af2302f-417d-f9cf-379a-3e4c647aef23
  • Service: dotnet-csharp
  • Sub-service: fundamentals

Metadata

Metadata

Assignees

Type

No type

Projects

Status

🔖 Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions