Pick properties of a class from a Dictionary


public

dictionary<byte, imgmdmessage> lplist = new dictionary<byte, imgmdmessage>();

class1 numberresp = new class1 ();

numberresp.deserializecommand(bytestream); //bytestream byte array

lplist.add(10, numberresp); class2 byteresp = new class2 ();

byteresp.deserializecommand(bytestream);

lplist.add(20, byteresp);    

here have added 2 deserialized objects dictionary. after deserializing class1, class2, properties of classes filled byte values.

lets class1 has following properties:  

public

byte add = bytestream[0];

public byte cmd = bytestream[1];

public byte len = bytestream[2];                                                                                     need use lplist dictionary in class , have class1 properties add, cmd, len.

can 1 me in this

                          


hi,

you can type each entry. this:
foreach (var entry in lplist.values)
{
  var t = entry.gettype();
  // can @ t.name or fullname
}

with kind regards,

konrad



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'