ArcMap Session

Discussion created by ldonahue on Aug 22, 2012
Latest reply on Aug 22, 2012 by ldonahue
I'm not seeing in the API a class or interface that lets me know if the current session of ArcMap is a new session or an existing one.

I have a button add-in that when clicked, I would like to do certain things to data if the map document is opened after being previously closed.  Otherwise, if the button is clicked again in the same session, don't do those certain things.  Certain things only need to happen if the ArcMap session is new and the button is clicked for the first time in that session.

For example, a button that launches a form that manipulates data.  During the ArcMap session, the form maintains state.  When ArcMap is closed and reopened, the form defaults, but the data the form maintains still has previous state.  I would rather not have to serialize the state of the form if I don't have to, but rather I'd like to query the state of the data, then update the form with those values, but I only want to do that once in a new session, as after that, the form maintains its state with the data.

Is there a better approach?