Пример #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
        private void FillFromArray <T>(T[] array, DelegateFormatString <T> dfs)
        {
            Type type = typeof(T);

            if (!SportRadarLineContainer.IsObjectArrayEmpty <T>(array))
            {
                List <string> l = new List <string>();

                foreach (T obj in array)
                {
                    string sData = dfs(obj);
                    l.Add(sData);
                }

                lock (m_oLocker)
                {
                    m_di[type] = l;
                }
            }
            else if (this.ContainsKey(type))
            {
                Debug.Assert(false);
            }
        }