EmailedEventHandler and EmailingEventHandler signatures  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

EmailedEventHandler and EmailingEventHandler signatures

Postby Microsharp » Mon Jun 27, 2022 3:15 am

Hi team

Is there a document we can look up all the delegate signatures?
Currently, we would like to know what EmailedEventHandler and EmailingEventHandler signatures are.
Please help. Thanks
Microsharp
Occasional Contributor
Occasional Contributor
 
Posts: 19
Joined: Wed Apr 29, 2015 4:51 pm
Topics Solved: 1

Re: EmailedEventHandler and EmailingEventHandler signatures  Topic is solved

Postby Scott.Pearce » Mon Jun 27, 2022 9:58 am

Here's one way:

Load up VS and create a new project (I created a windows console .NET Framework 4.8 project).
Add a reference to JiwaApplication.dll (or whichever assembly contains the object/event you are interested in)
Instantiate the object (in this case it is the manager object that throws the EmailSendBefore event):
Code: Select all
JiwaFinancials.Jiwa.JiwaApplication.Manager myManager = new JiwaFinancials.Jiwa.JiwaApplication.Manager();

Now add a handler for the event you are interested in:
Code: Select all
myManager.EmailSendBefore += myManager_EmailSendBefore;

Note how the compiler is upset because you have not defined the handler yet:
UpsetCompiler.png

Now, hover the mouse pointer over the error (the text with the red squiggle under it) and choose "Show potential fixes" from the context menu:
Show pontential fixes.png

Select "Generate method ..." from the list:
Generate method.png

Now you have the signature information!
Signature.png


There are likely other ways, and these would vary via IDE.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: EmailedEventHandler and EmailingEventHandler signatures

Postby SBarnes » Mon Jun 27, 2022 11:45 am

I usually just use a decompiler such as Just Decompile by Telerik which is free, the signatures are usually at the bottom of the relevant source files such as events in Sales Order are actually at the bottom of the Sales Order business logic class, you can also view them in visual basic or c#.

Using a decompiler also lets you see at what point events get called so for instance you can see what the difference is between an ending event and an end event for instance and also looking at a given method you can actually see if there is an appropriate event at all to hook onto to.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: EmailedEventHandler and EmailingEventHandler signatures

Postby pricerc » Mon Jun 27, 2022 2:50 pm

SBarnes wrote:I usually just use a decompiler such as Just Decompile by Telerik which is free, the signatures are usually at the bottom of the relevant source files such as events in Sales Order are actually at the bottom of the Sales Order business logic class, you can also view them in visual basic or c#.

Using a decompiler also lets you see at what point events get called so for instance you can see what the difference is between an ending event and an end event for instance and also looking at a given method you can actually see if there is an appropriate event at all to hook onto to.


I have found that there is some parts of the Jiwa codebase (VB-based stuff, I think) that Telerik's decompiler just won't handle, regardless of what language you're decompiling to.

I have found that the open source ILSpy handles everything, although there is no option to decompile to VB (if that matters to you).
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 504
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 20

Re: EmailedEventHandler and EmailingEventHandler signatures

Postby SBarnes » Mon Jun 27, 2022 2:58 pm

Redgate .net Reflector also handles the bits that Just Decompile won't and will decompile to either language but Just Decompile has the right price tag. :lol:

I've also used Just Decompile to convert a plugin such as the file watcher samples from vb.net to c# i.e. just find the compiled DLL that Jiwa deployed and open it, Just Decompile gets most of it right, it seems to struggle with indexers though.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: EmailedEventHandler and EmailingEventHandler signatures

Postby Mike.Sheen » Mon Jun 27, 2022 5:04 pm

SBarnes wrote:I've also used Just Decompile to convert a plugin such as the file watcher samples from vb.net to c# i.e. just find the compiled DLL that Jiwa deployed and open it, Just Decompile gets most of it right, it seems to struggle with indexers though.


I'm fond of this Visual Studio extension to convert between C# and VB.NET: https://github.com/icsharpcode/CodeConverter

It lets you right click on a source file in the solution explorer and in the context menu you get a "Convert to C#" or "Convert to VB" option, which - as you would expect - performs a conversion.

You can use it for plugins by just pasting in the plugin code to a new code file and then converting that.

I was tinkering with adding a tool on the ribbon of plugin maintenance to convert plugins from c# to vb and vice-versa - the source code for icsharpcode/CodeConverter is licensed under the MIT License, which permits us to use that code in any way we like with no real restrictions.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: EmailedEventHandler and EmailingEventHandler signatures

Postby SBarnes » Mon Jun 27, 2022 5:37 pm

I'm fond of this Visual Studio extension to convert between C# and VB.NET: https://github.com/icsharpcode/CodeConverter


I've played around with it also, I discovered it a couple of weeks back but it does not take well to say something like IReturn from ServiceStack in going from c# to Vb.net as it puts in inherits instead of Implements and Auto mapper code I had in the project confused the hell out of it.

Perhaps it would do a better job in turning vb.net into c# which is probably what it would get used for given a lot of the samples are vb.

It would be interesting to see how well it went with a big vb project/solution
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: EmailedEventHandler and EmailingEventHandler signatures

Postby pricerc » Wed Jun 29, 2022 5:08 pm

ILSpy is also developed by the icsharpcode team that does CodeConverter.

https://github.com/icsharpcode/ILSpy

Which makes one wonder why they don't have a decompile to VB option....
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 504
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 20

Re: EmailedEventHandler and EmailingEventHandler signatures

Postby Mike.Sheen » Wed Jun 29, 2022 5:24 pm

pricerc wrote:Which makes one wonder why they don't have a decompile to VB option....


Ewww... why would anyone want to do THAT?

:P
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: EmailedEventHandler and EmailingEventHandler signatures

Postby Scott.Pearce » Wed Jun 29, 2022 5:28 pm

I've been hanging out for COBOL support in Plugin Maintenance.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 32 guests