Esempio n. 1
0
        private byte[] LoadXmlFileAsWBXML(string filePath)
        {
            var xml = LoadXmlFile(filePath);

            var encoder = new ASWBXML();

            encoder.LoadXml(xml);
            return(encoder.GetBytes());
        }
Esempio n. 2
0
 // This function uses the ASWBXML class to encode
 // XML into a WBXML stream.
 private byte[] EncodeXMLString(string xmlString)
 {
     try
     {
         ASWBXML encoder = new ASWBXML();
         encoder.LoadXml(xmlString);
         return(encoder.GetBytes());
     }
     catch (Exception ex)
     {
         ASError.ReportException(ex);
         return(null);
     }
 }
Esempio n. 3
0
 internal static byte[] Encode(string stringXML)
 {
     try
     {
         ASWBXML encoder = new ASWBXML();
         encoder.LoadXml(stringXML);
         return(encoder.GetBytes());
     }
     catch (Exception ex)
     {
         LogService.Log("ASXML", "Failed to encode content: " + ex.Message);
         throw;
     }
 }
Esempio n. 4
0
 private byte[] EncodeXMLString(string stringXML)
 {
     try
     {
         ASWBXML encoder = new ASWBXML();
         encoder.LoadXml(stringXML);
         return(encoder.GetBytes());
     }
     catch (Exception ex)
     {
         //VSError.ReportException(ex);
         MessageBox.Show("Exception: \r\n" + ex.ToString(), "Error");
         System.Diagnostics.Debug.WriteLine("--------------------------");
         System.Diagnostics.Debug.WriteLine("Exception:");
         System.Diagnostics.Debug.WriteLine("  Message: " + ex.Message);
         System.Diagnostics.Debug.WriteLine("    Stack: " + ex.StackTrace);
         return(null);
     }
 }