Пример #1
0
        public void ToXmlTest()
        {
            PFList <string> testList = new PFList <string>();

            try
            {
                _msg.Length = 0;
                _msg.Append("ToXmlTest started ...\r\n");
                Program._messageLog.WriteLine(_msg.ToString());

                testList.Add("First item");
                testList.Add("Second item");
                testList.Add("Third item");

                string          xmlString = testList.ToXmlString();
                XmlDocument     xmlDoc    = testList.ToXmlDocument();
                PFList <string> testList2 = PFList <string> .LoadFromXmlString(xmlString);

                _msg.Length = 0;
                _msg.Append("\r\n\r\n");
                _msg.Append(xmlString);
                _msg.Append("\r\n\r\n");
                _msg.Append(xmlDoc.OuterXml);
                _msg.Append("\r\n\r\n");
                _msg.Append(testList2.ToString());
                _msg.Append("\r\n\r\n");
                Program._messageLog.WriteLine(_msg.ToString());
            }
            catch (System.Exception ex)
            {
                _msg.Length = 0;
                _msg.Append(AppGlobals.AppMessages.FormatErrorMessage(ex));
                Program._messageLog.WriteLine(_msg.ToString());
                AppMessages.DisplayErrorMessage(_msg.ToString(), _saveErrorMessagesToAppLog);
            }
            finally
            {
                _msg.Length = 0;
                _msg.Append("\r\n... ToXmlTest finished.");
                Program._messageLog.WriteLine(_msg.ToString());
            }
        }