Partition Management

Wed 26. Apr 2017, 17:00

I'm curious about the intended use of PartitionUnloaded/PartitionUnloading. I'm wanting to adjust some settings for certain entities within a user's claimed partitions, and apply those settings to new partitions as they're claimed. I can do this with PartitionLoaded(Guid, ObjectProxy), and it works just fine. Now I'm wanting to reset those values back to some default when the user unclaims the partition. I figured that would be best done via PartitionUnloading(Guid, ObjectProxy), but after setting a breakpoint within my override function I found that it isn't called when partitions are unclaimed, but is called when reverting changes to a particular partition. Is this the intended behavior? If so, are there any callbacks for when a user unclaims a partition (with or without reverting changes)?
tcarter
 
Posts: 14
Joined: Wed 19. Apr 2017, 22:08

Re: Partition Management

Thu 27. Apr 2017, 10:32

Your chosen approach make totally sense for me.

That you do not get a PartitionUnloading call is the desired behavior because the unclaim or publish action do not remove the objects of that partition from memory.
So what you need is a new event notification method, that is called just before a partition is published or unclaimed.
User avatar
[Articy] Peter Sabath
Articy Staff
Articy Staff
 
Posts: 89
Joined: Wed 23. Nov 2011, 13:58
Location: Bochum

Re: Partition Management

Fri 28. Apr 2017, 16:59

Thanks, Peter.
I assume a method for "publish/unclaim" isn't something I can write on my own, right? :D
Not resetting things during unclaim is fine for my project, since the correct settings get re-applied when partitions are claimed (assuming the other user is also using my plugin). I'm just wanting it for tidiness, so if you've got a to-do list for the next update, it's low priority.
tcarter
 
Posts: 14
Joined: Wed 19. Apr 2017, 22:08

Re: Partition Management

Thu 4. May 2017, 14:17

No you can't write/intercept partitioning related core methods.

But with 3.1 there will be an additional PartitionPublished API hook available.
User avatar
[Articy] Peter Sabath
Articy Staff
Articy Staff
 
Posts: 89
Joined: Wed 23. Nov 2011, 13:58
Location: Bochum

Re: Partition Management

Mon 8. May 2017, 22:36

Side note: when users redefine partitions, it would be nice to have a callback. I'm planning on auto-generating some files for use in individual partitions, so I'll need to know when they change.
tcarter
 
Posts: 14
Joined: Wed 19. Apr 2017, 22:08

Return to articy:draft Macro Devkit

Who is online

Users browsing this forum: No registered users and 13 guests

Who We Are
Contact Us
Social Links