Serialize the Data to XML

public static String SerializeInterface(object SerializedObject)       {           using (MemoryStream stream = new MemoryStream())           {               XmlSerializer serializer = null;               if (SerializedObject.GetType() == typeof(INTERFACE_ERRORS))               {                   serializer = new XmlSerializer(typeof(INTERFACE_ERRORS));                   INTERFACE_ERRORS o = (INTERFACE_ERRORS)SerializedObject;                   serializer.Serialize((Stream)stream, o);               }               else if (SerializedObject.GetType() == typeof(DETAILS_TO_SUB_SYSTEM))               {                   serializer = new XmlSerializer(typeof(DETAILS_TO_SUB_SYSTEM));                   DETAILS_TO_SUB_SYSTEM details_to_sub_system = (DETAILS_TO_SUB_SYSTEM)SerializedObject;                   serializer.Serialize((Stream)stream, details_to_sub_system);               }                stream.Seek(0L, SeekOrigin.Begin);               byte[] buffer... Continue Reading →

Create a website or blog at WordPress.com

Up ↑