There isn't much explaining to this, this is what I have:
Basically I want the data field in PACKET_DATA to be able to be either DATA_FILE or DATA_MESSAGE. I know the type needs to be changed but I don't know what to, is generics an option?
the end result should be so that I can do either:
pktData.data.fi leName
or
pktData.data.me ssage
Code:
public struct PACKET_HEADER { public string computerIp; public string computerName; public string computerCustomName; }; public struct PACKET { public PACKET_HEADER pktHdr; public PACKET_DATA pktData; }; public struct PACKET_DATA { public Command command; public string data; }; public struct DATA_MESSAGE { public string message; }; public struct DATA_FILE { public string fileName; public long fileSize; };
the end result should be so that I can do either:
pktData.data.fi leName
or
pktData.data.me ssage
Comment