Jump to content
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted

This is a log from my plugin.

(New means .ctor invoked - i have one in my plugin)

>>> New -------------------

>>> New -------------------

>>> New -------------------

>>> New -------------------

> CreateConfigDialog

> InitialInitToken

> Manager_Load

> InitDialogFromToken

> InitTokenFromDialog

>Closing

>>> New -------------------

> CreateConfigDialog

> InitialInitToken

> Manager_Load

> InitDialogFromToken

> InitTokenFromDialog

>Applied

>Closing

>>> New -------------------

>>> New -------------------

>>> New -------------------

> CreateConfigDialog

> InitialInitToken

> InitDialogFromToken

> Manager_Load

> InitDialogFromToken

> InitTokenFromDialog

>Closing

Numbers seams to change every time.

Posted

This isn't a bug. Your effect will be instantiated quite a bit, with at least one copy per thread. It's done this way for reliability reasons. Your Effect instance should be stateless as much as possible, with any configuration or caching done via the EffectConfigToken. The EffectConfigDialog serves strictly to configure the values in the EffectConfigToken, which are then sent along over to instances of the Effect class for rendering purposes.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Posted

And btw.

All those tokens and on is for nothing.

It makes plugin developing harder and you can live without it just

using Static Class (i think) ,and in VB.Net Module (that's for sure) that is a part of code accessible from the moment assembly is loaded till it's unloaded and is also thread safe.

I don't say you do it wrong. I just say it can be done easier.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...