Search code examples
c#.netdsldsl-tools

C# Create a hidden transaction


I am using C# and DSL Tools for VS2005.

I need to create Transactions to change some data but i want them to be hidden from the user, that means, to not show in the UNDO list in VS2005.

I tried by disabling the UndoManager

store.UndoManager.UndoState = UndoState.Disabled;

But by disabling it all existing previous actions in the undo list are cleared.

Transactions have a property called "isHidden" but it's readonly i don't know how i can set the to hidden. I also tried to create a new UndoManager but it's also a readonly property...

How can i create a transaction that does not appear in the undo list?

I'd be glad to write some more details in order to clarify any doubts, Thank you very much, Luís Filipe

[added]

i paint every shape's background based on a property value. E.g, green if true, red if false. I need to open a transaction to paint the shape's background but for me it behaves as a calculated (read-only) property.


Solution

  • store.UndoManager.UndoState = UndoState.Disabled;

    is almost right for what u want,

    store.UndoManager.UndoState = UndoState.DisabledNoFlush;

    this will not clear the rest of the undo list :) cyas at lunch Luis.