/// <summary> /// 增加系统配置 /// </summary> private void AddSysCtr() { m_Ctrs.Add(new CtrConfig() { m_Name = "ReceiveMsg", m_Callback = (x) => { m_ReceiveMsg = !m_ReceiveMsg; x.ChangeColor(m_ReceiveMsg ? Color.green : Color.white); }, m_Color = m_ReceiveMsg ? Color.green : Color.white, }); m_Ctrs.Add(new CtrConfig() { m_Name = "ToBottom", m_Callback = (x) => { m_ToBottom = !m_ToBottom; x.ChangeColor(m_ToBottom ? Color.green : Color.white); if (m_ToBottom) { JerryEventMgr.DispatchEvent(Enum_Event.Change2Bottom.ToString()); } }, m_Color = m_ToBottom ? Color.green : Color.white, }); m_Ctrs.Add(new CtrConfig() { m_Name = "MessageReceived", m_Callback = (x) => { m_UseMessageReceived = !m_UseMessageReceived; x.ChangeColor(m_UseMessageReceived ? Color.green : Color.white); }, m_Color = m_UseMessageReceived ? Color.green : Color.white, }); m_Ctrs.Add(new CtrConfig() { m_Name = "TraceLev", m_Callback = (x) => { m_TraceLev = ChangeTraceLev(m_TraceLev); x.ChangeColor(GetTraceLevColor(m_TraceLev)); }, m_Color = GetTraceLevColor(m_TraceLev), }); }
private TraceLev ChangeTraceLev(TraceLev lev) { switch (lev) { case TraceLev.None: { return(TraceLev.Simple); } case TraceLev.Simple: { return(TraceLev.Full); } case TraceLev.Full: { return(TraceLev.None); } } return(TraceLev.None); }
private Color GetTraceLevColor(TraceLev lev) { switch (lev) { case TraceLev.None: { return(Color.white); } case TraceLev.Simple: { return(Color.cyan); } case TraceLev.Full: { return(Color.green); } } return(Color.white); }