Does not work with VB.NET...

Apr 13, 2009 at 1:13 PM
Edited Apr 13, 2009 at 1:29 PM
I am having problems getting this to generate any VB.NET code.
Looks like the following fixes it:
In GeneratorFacade.cs, line 105, insert the following:

 

this.generatorParamsField.Language = language;

 


public GeneratorFacade(string inputFile, string nameSpace, GenerationLanguage language, CollectionType collectionType, bool enableDataBinding, bool hidePrivate, bool enableSummaryComment, List<NamespaceParam> customUsings, string collectionBase, bool includeSerializeMethod, string serializeMethodName, string deserializeMethodName, string saveToFileMethodName, string loadFromFileMethodName, bool disableDebug)

 

{

 

CodeDomProvider provider;

 

 

this.generatorParamsField.Language = language;

 

 

switch (this.generatorParamsField.Language)

 

{

 

case GenerationLanguage.CSharp:

 

provider =

new Microsoft.CSharp.CSharpCodeProvider();

 

 

break;

 

 

case GenerationLanguage.VisualBasic:

 

provider =

new Microsoft.VisualBasic.VBCodeProvider();

 

 

break;

 

 

case GenerationLanguage.VisualCpp:

 

provider =

new Microsoft.VisualC.CppCodeProvider();

 

 

break;

 

 

default:

 

provider =

new Microsoft.CSharp.CSharpCodeProvider();

 

 

break;

 

}

Apr 20, 2009 at 3:46 PM
I got it working by updating Utility.cs file as following:

public

 

static GenerationLanguage GetGenerationLanguage(string input)

 

 

 {

 

    if (string.IsNullOrEmpty(input)) return default(GenerationLanguage);

 

 

 

    switch (input.ToLower())

 

 

     {

             

case "cs":

 

 

             case "c#":

 

              

case "csharp":

 

              

case "visualcsharp":

 

                          

return GenerationLanguage.CSharp;

 

              

case "c":

 

              

case "cpp":

 

              

case "c+":

 

              

case "c++":

 

              

case "cplus":

 

              

case "cplusplus":

 

              

case "visualc":

 

              

case "visualcplus":

 

              

case "visualcplusplus":

 

                      

return GenerationLanguage.VisualCpp;

 

              

case "vb":

 

              

case "bas":

 

              

case "visualbasic":

 

                                return GenerationLanguage.VisualBasic;

     

}

 

 

 

    return ToEnum<GenerationLanguage>(input);

 

 

 }