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

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user