the Strange _stateStack in UndoBase

the Strange _stateStack in UndoBase

Old forum URL: forums.lhotka.net/forums/t/1186.aspx


jason2000 posted on Tuesday, September 12, 2006

"Undo" is very complex mechanism in CSLA and I study it with the version 2.1,

1.start debug;
2.select the project "Expert VB 2005 Business Objects" to edit.The project has three resources;
3.do nothing in the edit form(window);
4.click "cancel" button;
5.debug into BusinessBase.CancelEdit()
6.in the watch window,I found the value of _stateStack.Count of the first resource  is 2,but  the value of _stateStack.Count  of other resources is 1;
7.then step out;
8.loop step 4 to 7,I found the value of _stateStack of the first resource would step up,but  the value of _stateStack.Count  of other resources keeps 1 all the time;
9.I debug it using version 2.0.3, I found the same problem except different value;

What is wrong with it?

 

RockfordLhotka replied on Tuesday, September 12, 2006

There are some errata/notes you can find on www.lhotka.net/cslanet regarding the way data binding interacts with your object. If you are using data binding, you need to be fully aware of how the bindingsource object invokes the IEditableObject methods to understand how the n-level undo is being used on your behalf.

If you really want to just study the n-level undo functionality, I recommend against using data binding to avoid that complication.

(note that for real apps I DO recommend using data binding!! but for focusing in on the mechanics of n-level undo for learning purposes, data binding makes things quite complex...)

jason2000 replied on Tuesday, September 12, 2006

Thanks. Rocky.

I am going to develop an information management system based on CSLA.NET.Which version should I use, version 2.1(beta), version 2.1 or pending version 3.0?

 I need your advice.

RockfordLhotka replied on Wednesday, September 13, 2006

If you haven't started yet, then I think I'd go with 2.1 so you are as current as possible.
 
If you already have a code base the decision is more complex, because there are some breaking changes from 2.0 to 2.1.
 
Rocky


From: jason2000 [mailto:cslanet@lhotka.net]
Sent: Tuesday, September 12, 2006 10:18 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] the Strange _stateStack in UndoBase

Thanks. Rocky.

I am going to develop an information management system based on CSLA.NET.Which version should I use, version 2.1(beta), version 2.1 or pending version 3.0?

 I need your advice.




Copyright (c) Marimer LLC