Click here to Skip to main content
15,914,409 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is the code.

I want to get mManagementPort in other class!

C#
class GetConfig
public struct structManagementPort
        {
            public UInt16 PortFrom;
            public UInt16 PortTo;

            public structManagementPort(UInt16 pfrom, UInt16 pto)
            {
                PortFrom = pfrom;
                PortTo = pto;
            }
        }

List<structManagementPort> mManagementPort = new List<structManagementPort>();


public List<structManagementPort> ManagementPort
        {
            get { return this.mManagementPort; }
        }



C#
class ReceiveConfig

 GetConfig getConfig = new GetConfig();
 ????? = getCongig.ManagementPort;


mManagementPort is List<userdefinestruct> !!!
* UserDefineStruct --> structManagementPort


How can I Solve this problem...
what is there '?????' ....ㅠ_ㅠ Plz help... thanks..

What I have tried:

eeeeeeeeeeeevrythinggggggggggggggggg
Posted
Updated 14-Nov-18 1:21am
Comments
F-ES Sitecore 14-Nov-18 6:06am    
If you're having problems working out the type of something you can try

var x = ...

then in Visual Studio hover over "var" and it will tell you the type you need.

Not everything...
C#
class ReceiveConfig
    {
    void myMethod()
        {
        GetConfig getConfig = new GetConfig();
        List<GetConfig.structManagementPort> x = getConfig.ManagementPort;
        }
    }
 
Share this answer
 
Or,

class ReceiveConfig
    {
    void myMethod()
        {
        GetConfig getConfig = new GetConfig();
        var x = getConfig.ManagementPort;
        }
    }


Is this what you want?

If this did not solve your problem then please leave a comment and I will assist you by improving my solution until your problem gets solved.

Cheers,
AH
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900