/// <summary> /// Logs the specified text with as specified type to the viewport and any method assigned to the GUI.Logger /// </summary> /// <param name="textToLog"></param> /// <param name="type"></param> public static void Log(string textToLog, LogItemType type) { while (m_ViewPort == null || m_ViewPort.IsHandleCreated == false || m_ViewPort.Visible == false) { Thread.Sleep(15); } m_ViewPort.AppendToLog(textToLog, type); if (GUI.Logger != null) { Logger.Invoke(textToLog, type); } }
/// <summary> /// Logs the specified text with as specified type to the viewport and any method assigned to the GUI.Logger /// </summary> /// <param name="textToLog"></param> /// <param name="type"></param> public static void Log(string textToLog, LogItemType type) { if (m_threadViewPort == null) { m_threadViewPort = new Thread(new ThreadStart(DisplayViewPort)); m_threadViewPort.SetApartmentState(ApartmentState.STA); m_threadViewPort.IsBackground = true; m_threadViewPort.Name = "ViewPort"; m_threadViewPort.Start(); } while (m_ViewPort == null || m_ViewPort.IsHandleCreated == false || m_ViewPort.Visible == false) { Thread.Sleep(15); } m_ViewPort.AppendToLog(textToLog, type); if (GUI.Logger != null) { Logger.Invoke(textToLog, type); } }