Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I guess it is a longshot but i'll ask anyway:

Somtimes the declaration Enums is deeply nested in a class

Class Some
   Class VeryLong
       Class ClassNames
           Enum eBla
               Test
           End Enum

           Public Shared Sub TestSub(ByVal Bla As eBla)
           End Sub
       End Class
   End Class
End Class

 

And if one wanted to call TestSub it would result into a very long line:

Some.VeryLong.ClassNames(Some.VeryLong.ClassNames.Test)

 

Is there some way to shorten it to Some.VeryLong.ClassNames(Test)?

(Without moving the enum to another location)

Posted

You can use Import Aliases.

 

LongClass = Import Some.VeryLong.ClassNames

EblaEnum = Import Some.VeryLong.ClassNames.eBla

 

That way it's much shorter:

 

Public Sub Blah
    LongClass.TestSub(EblaEnum)
End Sub

 

Other than that, I dunno. :/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...