示例#1
0
        private void BuildTraceString <T>(DelegateFormatString dfs)
        {
            string sObjectListName          = LineContainer.ContentTypeToObjectListName(typeof(T));
            SerializableObjectList lObjects = m_di.SafelyGetValue(sObjectListName);

            if (lObjects != null && lObjects.Count > 0)
            {
                List <string> l = new List <string>();

                foreach (ISerializableObject so in lObjects)
                {
                    string sData = dfs(so);
                    l.Add(sData);
                }

                m_sTrace += string.Format("{0} (Count={1}): {2}\r\n", sObjectListName, l.Count, string.Join(", ", l.ToArray()));
            }
        }
示例#2
0
        public static LineContainer FromStream(Stream st)
        {
            try
            {
                using (XmlTextReader tr = new XmlTextReader(st))
                {
                    LineContainer lc = new LineContainer();
                    lc.FromXml(tr);

                    return(lc); // 4369910973073
                }
            }
            catch (Exception excp)
            {
                m_logger.Excp(excp, "FromStream() ERROR");
                throw;
            }

            return(null);
        }
示例#3
0
        public static LineContainer FromXml(string sXml)
        {
            try
            {
                using (StringReader sr = new StringReader(sXml))
                {
                    using (XmlTextReader tr = new XmlTextReader(sr))
                    {
                        LineContainer lc = new LineContainer();
                        lc.FromXml(tr);
                        lc.OriginalXml = sXml;

                        return(lc); // 4369910973073
                    }
                }
            }
            catch (Exception excp)
            {
                m_logger.Excp(excp, "FromXml() ERROR");
                throw;
            }

            return(null);
        }