© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
16 replies
Dark

❔ Dictionary of delegates for non-static functions. (Task & Action)

I'm trying to write a dictionary for delegates that when specific values are passed so I can invoke the delegate.
Currently code is written with a switch wanted todo with delegates though.
EX: Socks 5 packet is received, It calls the packet handler, Packet handle will check if packet exists in dictionary and invoke the delegate associated with it.
When this delegate is invoked I need it to know the object of the client so it's executing on correct client. So I need a way to pass what client/connection it is currently invoking this on, Non-static objects that are instantiated when a connection is made.
I would like to do this without using static functions and passing objects as parameter.
Sorry if this don't make sense not sure how to explain what I'm trying todo.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ ✅ Static vs. non-Static (?)
C#CC# / help
3y ago
Static vs Non-Static classes [Answered]
C#CC# / help
4y ago
Delegates
C#CC# / help
2y ago
❔ Delegates
C#CC# / help
3y ago