10670 : When deleting a timeitem, how is it possible to all succeding linked timeitems? And how could one make an undo command?

Question

When deleting a timeitem, how is it possible to delete all succeding linked timeitems? And how could one make an undo command, to restore the deleted timeitems, including the links? Thank you in advance, Nicholas

Answer

When deleting the time item you can check the LinkStartCount and LinkTargetCount of the time item. You can access these TimeItemLinks with methods LinkStart(i) and LinkTarget(i) of the time item.

These TimeItemLinks should then (probably) be removed with TimeItemLink.DropLink.

In the very near future it will be possible to handle DataBind of the time items links as well (we are done and it this article explains how to use it https://plexityhide.com/GTPNETOverview.htm).

I think that this is the best approach if you want to handle undo etc. You can then have your data in a dataset and you can have a copy of the dataset from an earlier time. Then an Undo is merly a matter of switching datasets (back to an older one)…