public void Generate(bool writeToFile = true)
        {
            codeGenerator.Generate(writeToFile);
            GeneratedDomainCode = codeGenerator.GeneratedCode;

            if (applicationPreferences.IsFluent)
            {
                fluentGenerator.Generate(writeToFile);
                GeneratedMapCode = fluentGenerator.GeneratedCode;
            }
            else if (applicationPreferences.IsCastle)
            {
                castleGenerator.Generate(writeToFile);
                GeneratedMapCode = castleGenerator.GeneratedCode;
            }
            else if (applicationPreferences.IsByCode)
            {
                byCodeGenerator.Generate(writeToFile);
                GeneratedMapCode = byCodeGenerator.GeneratedCode;
            }
            else
            {
                mappingGenerator.Generate(writeToFile);
                GeneratedMapCode = mappingGenerator.GeneratedCode;
            }

            if (applicationPreferences.GenerateWcfDataContract)
            {
                contractGenerator.Generate(writeToFile);
            }
        }
 public void Generate()
 {
     codeGenerator.Generate();
     if (applicationPreferences.IsNhFluent)
     {
         nhFluentGenerator.Generate();
     }
     else if (applicationPreferences.IsFluent)
     {
         fluentGenerator.Generate();
     }
     else if (applicationPreferences.IsCastle)
     {
         castleGenerator.Generate();
     }
     else if (applicationPreferences.IsByCode)
     {
         byCodeGenerator.Generate();
     }
     else
     {
         mappingGenerator.Generate();
     }
     if (applicationPreferences.GenerateWcfDataContract)
     {
         contractGenerator.Generate();
     }
 }