I am porting some code from a PC to a PocketPC. I want to read data
from an XML-file into a hashtable. But since the soapformatter does not
exist in the compact framework I have to find a workaround. I have
tried to use xmlserializer, but it always wants me to supply it with a
type. If I use the type of hashtable I get an exception. Any help or
hints would be highly appreciated.
Below is the code as it more or less looks in my program :
[Serializable]
public struct CMDCLASSES
{
public Hashtable CmdClasses;
}
public CMDCLASSES ReadXml(string filename)
{
Stream streamReader = null;
CMDCLASSES temp = new CMDCLASSES();
SoapFormatter serializer = new SoapFormatter();
streamReader = File.OpenRead(filename);
if (streamReader != null)
{
temp = (CMDCLASSES)serializer.Deserialize(streamReader);
}
streamReader.Close();
return temp;
}