private CLogLevel(int priority, string name, string shortName, CColorCode color = CColorCode.Clear, CColorCode backColor = CColorCode.Clear) { this.Priority = priority; this.Name = name; this.ShortName = shortName; this.Color = color; this.BackColor = backColor; Register(this); }
internal void SetColor(CColorCode code, Color color) { int index = (int)code; if (index < 0 || index >= m_lookup.Length) { throw new ArgumentOutOfRangeException("index"); } m_lookup[index] = color; }
public Color GetColor(CColorCode code) { int index = (int)code; if (index >= 0 && index < m_lookup.Length) { return(m_lookup[index]); } return(m_lookup[(int)CColorCode.Clear]); }
////////////////////////////////////////////////////////////////////////////// private CTableViewCell CreateTableCell(CTableView table, ref CConsoleViewCellEntry entry) { if (entry.IsPlain || entry.IsTable) { CConsoleTextEntryView cell; if (entry.level == CLogLevel.Exception) { CConsoleTextEntryExceptionView exceptionCell = table.DequeueReusableCell <CConsoleTextEntryExceptionView>(); if (exceptionCell == null) { exceptionCell = new CConsoleTextEntryExceptionView(); } exceptionCell.StackTraceLines = entry.data as CStackTraceLine[]; cell = exceptionCell; } else { cell = table.DequeueReusableCell <CConsoleTextEntryView>(); if (cell == null) { cell = new CConsoleTextEntryView(); } } // set the size first to calculate individual lines height CColorCode colorCode = entry.level != null ? entry.level.Color : CColorCode.Plain; cell.TextColor = CEditorSkin.GetColor(colorCode); cell.Width = entry.width; cell.Height = entry.height; cell.Value = entry.value; cell.LogLevel = entry.level; cell.StackTrace = entry.stackTrace; return(cell); } else { throw new NotImplementedException("Unexpected entry type"); } }
internal static string C(string str, CColorCode color) { return(CStringUtils.TryFormat("<color=${0}>{1}</color>", ((int)color).ToString(), str)); }
internal static string C(string str, CColorCode color) { return(CStringUtils.C(str, color)); }
internal static void SetColor(CColorCode code, Color color) { colors.SetColor(code, color); }
public static Color GetColor(CColorCode code) { return(colors.GetColor(code)); }
private static string toDisplayName(CCommand cmd) { CColorCode color = cmd is CVarCommand ? CColorCode.TableVar : cmd.ColorCode; return(CStringUtils.C(cmd.Name, color)); }