I am trying to create a dll that looks up a name from a list of ENUM and returns a serial control string to control an external device.
My problem is the full namespace needs to be put befor the ENUM to use it.
This is my class called PSdata
This is the EXE that will use the DLL.
As you can see, I need to use the full Namespace to reference the enum
TextBox1.Text = PSdata.PSCommand(PSdata.enmCommand.MultiScreen)
Any what I can make this become
TextBox1.Text = PSdata.PSCommand(MultiScreen)
My problem is the full namespace needs to be put befor the ENUM to use it.
This is my class called PSdata
VB.NET:
Namespace Nortronics
Public Class PSdata
Enum enmCommand
CameraSelect
MultiScreen
End Enum
Shared Function PSCommand(ByVal myCommand As enmCommand) As String
Select Case myCommand
Case enmCommand.CameraSelect
Return "OCS"
Case enmCommand.MultiScreen
Return "OMS"
Case Else
Return "nothing"
End Select
End Function
End Class
End Namespace
This is the EXE that will use the DLL.
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim PSdata As PSdata.Nortronics.PSdata
TextBox1.Text = PSdata.PSCommand(PSdata.enmCommand.MultiScreen)
End Sub
As you can see, I need to use the full Namespace to reference the enum
TextBox1.Text = PSdata.PSCommand(PSdata.enmCommand.MultiScreen)
Any what I can make this become
TextBox1.Text = PSdata.PSCommand(MultiScreen)