techmanbd
Junior Contributor
Here is the following code. I have a class, and access it in my main form.
Part of my class comGPIB
And here is the code from my main form
When I do cGPIB. in the drop down box I can see the public integer and the public boolean variable, but not the enums I created.
Now when I do this I see it and it work, by putting the namespace.
Is there an explanation for this? I tried reading the help files and didn't see anything on why I need the namespace for the enum in that class.
Thanks,
Part of my class comGPIB
C#:
public class comGPIB
{
Board brd = new Board();
Device devdev = new Device(0,0);
public int iHELLO;
public Device [] devGPIB = new Device[5];
public bool boolPSConnected;
public enum Dev {PS=0, AGSwitch1=1, AGSwitch2=2, KeithleyMM=3};// Used for which array for devGPIB
public enum PS {Agilent=0,Xantrex=1}; //Used when for which Power Supply is found on the GPIB Network
}
And here is the code from my main form
C#:
comGPIB cGPIB = new comGPIB();// this is up at the top where my variables are
private void btnPractice_Click(object sender, System.EventArgs e)
{
string readIt = cGPIB.readGPIB(cGPIB.devGPIB[1]);
this.lblPract.Text = readIt;
}
When I do cGPIB. in the drop down box I can see the public integer and the public boolean variable, but not the enums I created.
Now when I do this I see it and it work, by putting the namespace.
C#:
int i = HBAS_PVFT_Rack.comGPIB.Dev.AGSwitch1;
Is there an explanation for this? I tried reading the help files and didn't see anything on why I need the namespace for the enum in that class.
Thanks,