public void Add(EventType eventType, string strData) { CommLogEvent commLogEvent = new CommLogEvent(DateTime.Now, eventType, strData); m_arrList.Add((object)commLogEvent); if (m_arrList.Count > 100) m_arrList.RemoveAt(0); if (!m_bCommLogging) return; m_streamWriter = File.AppendText("commlog.txt"); m_streamWriter.WriteLine(commLogEvent.ToString()); m_streamWriter.Close(); }
public void Add(EventType eventType, string strData) { CommLogEvent commLogEvent = new CommLogEvent(DateTime.Now, eventType, strData); m_arrList.Add((object)commLogEvent); if (m_arrList.Count > 100) { m_arrList.RemoveAt(0); } if (!m_bCommLogging) { return; } m_streamWriter = File.AppendText("commlog.txt"); m_streamWriter.WriteLine(commLogEvent.ToString()); m_streamWriter.Close(); }