简体   繁体   中英

Notification from the dll to the winform application

I have created a C# project , and using it's dll as a reference in another Winform application and calling the functions present in the dll project.

I have a requirement that , I have to call a winform's function from that dll. Is there any way I can register a function to my dll ? Or any other way I am able to notify the winform application from the dll , in some condition ?

I just want to send a kind of notification from the dll to the winform application .

I will be using WCF to wrap-up the dll project .(any help ?)

Ideas/Code samples will be much helpful.

The mechanism used by c# for this purpose is called an event .

You will define this event inside your dll project. Your Winforms project will register to this event, and it will run a method each time the event is fired from the dll.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM