This project has moved. For the latest updates, please go here.

vb templates

Developer
Oct 6, 2010 at 3:13 PM

Is anyone working on templates for vb.net.

I would be willing to help out.

Would it be best to look at the differences from C#3.5->4.0 and aply them to the VB3.5 templates or has too much changed and it would be best to start from the C#4.0 templates and do a complete convert.

Bill

Coordinator
Oct 6, 2010 at 7:00 PM

Hi Bill,

I'm glad you can help. I'm not sure what's the best way to do it.

The C# base was the 2.0 set of templates and a lot a things changed since 2.0...

On one hand we have to remember VB templates use 3.5... On the other hand, that are really a lot of changes: new features, authorization.

I have to have a good look and get back to you later.

Cheers,
Tiago Freitas Leal

Coordinator
Oct 9, 2010 at 11:59 PM
Edited Oct 10, 2010 at 12:01 AM

Hi again Bill,

Just commited change set 3310. That was a lot of work but I think it improves a lot on the usability side. The simple fact of selecting the current choices on eevry drop down list saves us the trouble of reselecting everything again, when the mouse (or the finger) slips...

Concerning VB templates, I gave it a good thought and I guess it's better to start all over. Both families of templates were aparted a long time ago. As you know there were no 3.5 templates and I chnged a lot the C# 2.0 templates. I jumped from 2.0 to 4.0 and restyled a lot (they were almost unreadable), made a lot of helper classes (almost all in CslaTemplateHelperAdded.cs) to help in readability. Most of these classes are C# oriented so I guess one must reproduce them in VbCslaTemplateHelper.cs

That's a lot of work to do! If you are willing to go ahead, I'll give all the help I can.

Cheers,

Tiago


Developer
Oct 10, 2010 at 7:44 PM

Hi Tiago,

Thanks fo rthe reply.

What do you (or anyone else) think about taking a copy of the C# 4.0 templates, leaving the CodeSmith code in C# and change the output to be for VB. That would make is easier to compare for changes in the future and would be less work.

Is that something that is acceptable in CodeSmith or is it preferable to stick with the same language. (Apologies if this is s stupid question, but I haven't used CodeSmith except to make minor changes to CSLAGen).

Also would it be easier to make the changes if I purchase a full version of CodeSmith.

Regards,

Bill

Coordinator
Oct 11, 2010 at 9:30 PM

Hi Bill,

Using the same language for generating C# and VB and change only the output it's a great idea! I believe the reason people do templates in the same language of the output is just because of the "Babel syndrome" - I only speak my own language. Of course it would be a lot easier to maintain.

Concerning the full version of CodeSmith I think you mean editing the template. I guess you expect the CodeSmith editor to have syntax highlighting etc. I use Notepad++ and made some configurations on it so it handles the template files as C#. But yes, I admit this isn't enough. I'm so used to Notepad++ that never looked around for freeware alternatives. Maybe there's no need for the full CodeSmith. I'll look around. May I suggest you do the same?

We'll keep in touch. Cheers

Tiago

Developer
Oct 12, 2010 at 2:01 PM

Tiago,

I think I will rename all the files with  a .asp extension added, then use VS2008 to edit as VS2008 will treat them as asp files and I will be able to collapse a lot of the codesmith code and be able to concentrate on converting the C# output to VB.

Bill

Coordinator
Oct 25, 2010 at 1:08 AM
Blarm wrote:

Tiago,

I think I will rename all the files with  a .asp extension added, then use VS2008 to edit as VS2008 will treat them as asp files and I will be able to collapse a lot of the codesmith code and be able to concentrate on converting the C# output to VB.

Bill

Hi Bill,

Did you try the rename to .asp trick? Did it worked all right?

Regards,

Tiago

Developer
Oct 25, 2010 at 8:12 AM

Tiago,

The rename worked and I have started to go through the templates and convert the output to vb.

Regards,

Bill

Coordinator
Oct 25, 2010 at 10:34 PM

Bill,

A lot of the code - C# code - is generated by CslaTemplateHelper.cs and CslaTemplateHelperAdded.cs
I guess I will have to replicate those methods in VbCslaTemplateHelper.cs and a new VbCslaTemplateHelperAdded.cs

Another change that will make maintenance easier is the use of "var" implicit type declaration. Is there a feature like this in VB or should I revert to explicit type declaration?

Developer
Oct 25, 2010 at 11:14 PM

You can do this in vb.net

        Dim bx1 = 5 'Integer
        Dim bx2 = "fsdfds" 'String
        Dim bx3 = New With {.Name = "ww", .Age = 6} 'Anonymous type
        Dim bx4 = 5 / 9 'Double
        Dim bx5 = New Date(2010, 10, 23) 'Date

Bill

 

Nov 16, 2010 at 8:08 AM

I also found another one. Line 95 at EditableRootCollection.cst.

MyBase.DataPortal_Update() doesnt work. It needs Child_Update() instead.