/// <summary> /// 将xmlByte解析为obj /// </summary> /// <param name="xmlByte"></param> /// <param name="obj"></param> /// <returns></returns> private bool XmlDeSerializer(byte[] xmlByte, object obj) { try { //判断字符串是否为空 if (xmlByte != null) { ESRI.ArcGIS.esriSystem.IPersistStream pStream = obj as ESRI.ArcGIS.esriSystem.IPersistStream; ESRI.ArcGIS.esriSystem.IXMLStream xmlStream = new ESRI.ArcGIS.esriSystem.XMLStreamClass(); xmlStream.LoadFromBytes(ref xmlByte); pStream.Load(xmlStream as ESRI.ArcGIS.esriSystem.IStream); return(true); } return(false); } catch (Exception eError) { //********************************************* //guozheng 2010-12-24 平安夜 added 系统异常日志 //if (ModData.SysLog == null) ModData.SysLog = new clsWriteSystemFunctionLog(); //ModData.SysLog.Write(eError); //********************************************** return(false); } }
/// <summary> /// 将xmlByte解析为obj /// </summary> /// <param name="xmlByte"></param> /// <param name="obj"></param> /// <returns></returns> private bool XmlDeSerializer(byte[] xmlByte, object obj) { try { //判断字符串是否为空 if (xmlByte != null) { ESRI.ArcGIS.esriSystem.IPersistStream pStream = obj as ESRI.ArcGIS.esriSystem.IPersistStream; ESRI.ArcGIS.esriSystem.IXMLStream xmlStream = new ESRI.ArcGIS.esriSystem.XMLStreamClass(); xmlStream.LoadFromBytes(ref xmlByte); pStream.Load(xmlStream as ESRI.ArcGIS.esriSystem.IStream); return(true); } return(false); } catch { return(false); } }