Exemplo n.º 1
0
        internal static string SymbolDataToString(SymbolData symbolData)
        {
            MemoryStream memoryStream = new MemoryStream();

            symbolData.SaveToStream(memoryStream);
            memoryStream.Seek(0L, SeekOrigin.Begin);
            byte[] inArray = memoryStream.ToArray();
            memoryStream.Close();
            return(Convert.ToBase64String(inArray));
        }
Exemplo n.º 2
0
        internal static SymbolData SymbolDataFromString(string data)
        {
            byte[]        array         = new byte[1000];
            MemoryStream  memoryStream  = new MemoryStream();
            XmlTextReader xmlTextReader = new XmlTextReader(new StringReader("<base64>" + data + "</base64>"));

            xmlTextReader.Read();
            int num = 0;

            while ((num = xmlTextReader.ReadBase64(array, 0, 1000)) > 0)
            {
                memoryStream.Write(array, 0, num);
            }
            xmlTextReader.Read();
            memoryStream.Seek(0L, SeekOrigin.Begin);
            SymbolData symbolData = new SymbolData();

            symbolData.LoadFromStream(memoryStream);
            xmlTextReader.Close();
            memoryStream.Close();
            return(symbolData);
        }