This is a migrated thread and some comments may be shown as answers.

Convert Static class from C# is not write

2 Answers 12 Views
Code Converter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
atul
Top achievements
Rank 1
atul asked on 19 Oct 2011, 12:40 AM
1. Convert static class from C# to vb.net changes static to noniheritable which is basically sealed though i think if i am not wrong it should be module.

2. Converting module from vb.net to c# changes module to static which is write i guess.

But i still need some suggestion from you guys?

Kind Regards,
Atul Chaudhary

2 Answers, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 20 Oct 2011, 09:41 PM
Hello Atul-

You are correct.

Converting from VB Module to C# should produce a static class since modules are essentially "static" in VB.

As for converting static classes to VB, it's a bit trickier. VB does not have a "static class" concept that maps 1:1 to C#. In general, Modules are a close substitue, but they're not identical. A NonInheritable class is also similar (since modules cannot be inherited), but it also has differences. This thread may be useful as it has some good discussion on the matter:

http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/aa2427e3-a57f-4c38-adb9-0496d7e3eb9a/

Hope that helps.

-Todd
0
atul
Top achievements
Rank 1
answered on 21 Oct 2011, 08:59 AM
Hi Todd,

I am using Module instead of NonInheritable now. Thanks for ur prompt reply.

Kind Regards,
Atul Chaudhary
Tags
Code Converter
Asked by
atul
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
atul
Top achievements
Rank 1
Share this question
or