Designer should overwrite previous files!

Posts   
 
    
Posts: 1
Joined: 31-Mar-2004
# Posted on: 31-Mar-2004 14:13:06   

Hi LLBLGen users,

I don't understand why the designer doesn't allow to overwrite your previously generated DAL classes. Now I have to delete all my files first. I think that overwriting should be possible when the files are not read-only (i.e. when checked-in using SourceSafe).

--Dion

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 31-Mar-2004 14:29:03   

It does overwrite the classes (if they're writable) but not all of them. The class not overwritten are the ones which can contain code added by the developer.

You can change this behaviour in the following way: In the Taskperformers directory in the LLBLGen Pro installation folder, you'll find the config files for the various generator configurations.

Copy the one you want to use to a different name. Open it in a text editor, it is XML. Change the contents of the name tag to a new name.

You'll see a lot of tasks with parameters like 'failWhenExistent'. An example is given below:


<task name="EntityValidatorClassGenerator" assemblyFilename="SD.LLBLGen.Pro.TaskPerformers.dll" taskPerformerClass="SD.LLBLGen.Pro.TaskPerformers.CodeEmitter">
    <parameter name="destinationFolder" value="ValidatorClasses"/>
    <parameter name="failWhenExistent" value="true"/>
    <parameter name="filenameFormat" value="[elementName]Validator.[extension]"/>
    <parameter name="templateID" value="SD_EntityValidatorTemplate"/>
    <parameter name="emitType" value="allEntities"/>
</task>

This is the task which generates the validator classes for example. As you can see failWhenExistent is set to true. If you change that in your copy to false, and you save the config, and after that you use the config in the generator configuration screen, you'll see the classes are overwritten, except when they're read-only.

To select a configuration as your default, set it as your default in the preferences of the designer.

The format for these tags is described in the SDK available in the customer area.

Frans Bouma | Lead developer LLBLGen Pro