static void Log_Write(String entry) { if (m_ListLog != null) { if (m_ListLog.InvokeRequired) { Log_WriteCallback d = new Log_WriteCallback(Log_Write); m_ListLog.Invoke(d, new object[] { entry }); } else { m_ListLog.Items.Add(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ": " + entry); int nTopIndex = m_ListLog.Items.Count - m_ListLog.Height / m_ListLog.ItemHeight; if (nTopIndex < 0) { nTopIndex = 0; } m_ListLog.TopIndex = nTopIndex; } } }
static void Log_Write(String entry) { if (m_ListLog != null) { if (m_ListLog.InvokeRequired) { Log_WriteCallback d = new Log_WriteCallback(Log_Write); m_ListLog.Invoke(d, new object[] { entry }); } else { m_ListLog.Items.Add(DateTime.Now + " - " + entry); int nTopIndex = m_ListLog.Items.Count - m_ListLog.Height / m_ListLog.ItemHeight; if (nTopIndex < 0) nTopIndex = 0; m_ListLog.TopIndex = nTopIndex; } } }