ProjectDefinition.MarkProjectAsChanged()

Posts   
 
    
Cadmium avatar
Cadmium
User
Posts: 153
Joined: 19-Sep-2003
# Posted on: 27-Jul-2006 00:14:14   

I'm having a little issue with ProjectDefinition.MarkProjectAsChanged(). I'm adding some properties to the projectdefintion duing a custom task and callling the above function (though NoChangeEvent must be set to true first).

The project in the Project Explorer gets marked as expected, however if I try to close the project I do not get a "save?" dialog. It's a minor thing but could cause users to loose their data. Any ideas?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 27-Jul-2006 03:26:19   

What do you mean by The project in the Project Explorer gets marked as expected?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39621
Joined: 17-Aug-2003
# Posted on: 27-Jul-2006 11:21:25   

It should give you the 'do you want to save lalala' message because the project is changed. Though you shouldn't set NoChangeEvent to true, as that would make the project not signal it was changed to observers.

Though if I were you, I'd move the tasks you want to do to a plugin and leave the tasks for code generation / output purposes.

Frans Bouma | Lead developer LLBLGen Pro
Cadmium avatar
Cadmium
User
Posts: 153
Joined: 19-Sep-2003
# Posted on: 27-Jul-2006 16:58:34   

Otis wrote:

It should give you the 'do you want to save lalala' message because the project is changed. Though you shouldn't set NoChangeEvent to true, as that would make the project not signal it was changed to observers.

Though if I were you, I'd move the tasks you want to do to a plugin and leave the tasks for code generation / output purposes.

Sorry, I meant I set the NoChangeEvent to false.... well specifically I save what it is in a tmp variable, set it to false, then set it back to whatever it was (which I beleive is true at that point).

I'm avoiding using a plugin because I'm looking for a specific behavior that popups up a configuration dialog when the user does a regen. Unless I'm missing something a plugin can't popup a dialog during that time?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39621
Joined: 17-Aug-2003
# Posted on: 28-Jul-2006 12:19:44   

Cadmium wrote:

Otis wrote:

It should give you the 'do you want to save lalala' message because the project is changed. Though you shouldn't set NoChangeEvent to true, as that would make the project not signal it was changed to observers.

Though if I were you, I'd move the tasks you want to do to a plugin and leave the tasks for code generation / output purposes.

Sorry, I meant I set the NoChangeEvent to false.... well specifically I save what it is in a tmp variable, set it to false, then set it back to whatever it was (which I beleive is true at that point).

I'm avoiding using a plugin because I'm looking for a specific behavior that popups up a configuration dialog when the user does a regen. Unless I'm missing something a plugin can't popup a dialog during that time?

I think I know what's the cause. The code generation start routine preserves the project change state till after the generation cycle has been completed, then it stores the data used for the generation process like rootnamespace etc. which then will mark a project as changed if it's different. So your change marking doesn't have any effect.

You can't run a plugin at generation time indeed...

Frans Bouma | Lead developer LLBLGen Pro
Cadmium avatar
Cadmium
User
Posts: 153
Joined: 19-Sep-2003
# Posted on: 28-Jul-2006 17:15:13   

Otis wrote:

You can't run a plugin at generation time indeed...

What am I doing to your baby? wink