Convert Static class from C# is not write

3 posts, 0 answers
  1. atul
    atul avatar
    7 posts
    Member since:
    Apr 2011

    Posted 18 Oct 2011 Link to this post

    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. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 20 Oct 2011 Link to this post

    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
  3. atul
    atul avatar
    7 posts
    Member since:
    Apr 2011

    Posted 21 Oct 2011 Link to this post

    Hi Todd,

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

    Kind Regards,
    Atul Chaudhary
Back to Top