public void OnConsoleEntryAdded(AbstractConsole console, ref ConsoleViewCellEntry entry) { CycleArray <ConsoleViewCellEntry> Entries = this.Entries; // if unfiltered console entries overflow - we need to adjust indices and visible lines if (m_oldConsoleEntriesHeadIndex < Entries.HeadIndex) { m_oldConsoleEntriesHeadIndex = Entries.HeadIndex; int indicesHeadIndex = m_filteredIndices.HeadIndex; while (indicesHeadIndex < m_filteredIndices.Length && m_filteredIndices[indicesHeadIndex] < Entries.HeadIndex) { ++indicesHeadIndex; } m_filteredIndices.TrimToHeadIndex(indicesHeadIndex); m_consoleView.TrimCellsToHead(indicesHeadIndex); } int entryIndex = Entries.Length - 1; int entryArrayIndex = Entries.ToArrayIndex(entryIndex); if (Apply(ref Entries.InternalArray[entryArrayIndex])) { m_filteredIndices.Add(entryIndex); m_consoleView.OnConsoleEntryAdded(console, ref entry); } }
public virtual void Add(LogLevel level, Tag tag, string[] table, string stackTrace) { ConsoleViewCellEntry entry = new ConsoleViewCellEntry(table); entry.level = level; entry.tag = tag; entry.stackTrace = stackTrace; Add(entry); }
private float HeightForTableCell(ref ConsoleViewCellEntry entry) { if (entry.width != this.ContentWidth) { entry.Layout(m_textMeasure, this.Width - UISize.ScrollBarWidth, this.ContentWidth); } return(entry.height); }
public void OnConsoleEntryAdded(AbstractConsole console, ref ConsoleViewCellEntry entry) { if (entry.IsTable) { string[] table = entry.Table; foreach (string item in table) { terminalTableOutput.Add(StringUtils.RemoveRichTextTags(item)); } } }
public void TestFlowLayoutSinglelWordEqualToMaxWidth() { Vector2 size = new Vector2(5, 1); string line = "12345"; ConsoleViewCellEntry entry = new ConsoleViewCellEntry(line); entry.Layout(this, size.x); AssertCellEntryLayout(entry, size, "12345" ); }
public bool Apply(ref ConsoleViewCellEntry entry) { for (int i = 0; i < m_filters.Count; ++i) { if (!m_filters[i].Apply(ref entry)) { return false; } } return true; }
public bool Apply(ref ConsoleViewCellEntry entry) { for (int i = 0; i < m_filters.Count; ++i) { if (!m_filters[i].Apply(ref entry)) { return(false); } } return(true); }
internal void Add(ConsoleViewCellEntry entry) { if (ThreadUtils.IsUnityThread()) { Entries.Add(entry); Delegate.OnConsoleEntryAdded(this, ref entry); } else { TimerManager.ScheduleTimer(() => { Add(entry); }); } }
////////////////////////////////////////////////////////////////////////////// private TableViewCell CreateTableCell(TableView table, ref ConsoleViewCellEntry entry) { if (entry.IsPlain || entry.IsTable) { ConsoleTextEntryView cell; if (entry.level == LogLevel.Exception) { ConsoleTextEntryExceptionView exceptionCell = table.DequeueReusableCell <ConsoleTextEntryExceptionView>(); if (exceptionCell == null) { exceptionCell = new ConsoleTextEntryExceptionView(); } exceptionCell.StackTraceLines = entry.data as StackTraceLine[]; cell = exceptionCell; } else { cell = table.DequeueReusableCell <ConsoleTextEntryView>(); if (cell == null) { cell = new ConsoleTextEntryView(); } } // set the size first to calculate individual lines height ColorCode colorCode = entry.level != null ? entry.level.Color : ColorCode.Plain; cell.TextColor = EditorSkin.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"); } }
public abstract bool Apply(ref ConsoleViewCellEntry entry);
////////////////////////////////////////////////////////////////////////////// #region IConsoleDelegate null implementation public void OnConsoleEntryAdded(AbstractConsole console, ref ConsoleViewCellEntry entry) { }
public void TestTableLayoutSevenItemsTwoRows() { Vector2 size = new Vector2(18, 3); List<string> lines = new List<string>(); lines.Add("1111"); lines.Add("2222"); lines.Add("3333"); lines.Add("4444"); lines.Add("5555"); lines.Add("6666"); lines.Add("7777"); ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines.ToArray()); entry.Layout(this, size.x); AssertCellEntryLayout(entry, size, "1111" + kSpace + "4444" + kSpace + "7777" + "\n" + "2222" + kSpace + "5555" + "\n" + "3333" + kSpace + "6666" ); }
public override bool Apply(ref ConsoleViewCellEntry entry) { return entry.level != null && entry.level.Priority >= m_level.Priority; }
public override bool Apply(ref ConsoleViewCellEntry entry) { return CultureInfo.CurrentCulture.CompareInfo.IndexOf(entry.value, m_text, CompareOptions.IgnoreCase) != -1; }
public void OnConsoleEntryAdded(AbstractConsole console, ref ConsoleViewCellEntry entry) { }
////////////////////////////////////////////////////////////////////////////// #region IConsoleDelegate implementation public void OnConsoleEntryAdded(AbstractConsole console, ref ConsoleViewCellEntry entry) { ReloadNewData(); Repaint(); }
////////////////////////////////////////////////////////////////////////////// private TableViewCell CreateTableCell(TableView table, ref ConsoleViewCellEntry entry) { if (entry.IsPlain || entry.IsTable) { ConsoleTextEntryView cell; if (entry.level == LogLevel.Exception) { ConsoleTextEntryExceptionView exceptionCell = table.DequeueReusableCell<ConsoleTextEntryExceptionView>(); if (exceptionCell == null) { exceptionCell = new ConsoleTextEntryExceptionView(); } exceptionCell.StackTraceLines = entry.data as StackTraceLine[]; cell = exceptionCell; } else { cell = table.DequeueReusableCell<ConsoleTextEntryView>(); if (cell == null) { cell = new ConsoleTextEntryView(); } } // set the size first to calculate individual lines height ColorCode colorCode = entry.level != null ? entry.level.Color : ColorCode.Plain; cell.TextColor = EditorSkin.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"); } }
public override bool Apply(ref ConsoleViewCellEntry entry) { return m_delegate(ref entry); }
public void OnConsoleEntryAdded(AbstractConsole console, ref ConsoleViewCellEntry entry) { CycleArray<ConsoleViewCellEntry> Entries = this.Entries; // if unfiltered console entries overflow - we need to adjust indices and visible lines if (m_oldConsoleEntriesHeadIndex < Entries.HeadIndex) { m_oldConsoleEntriesHeadIndex = Entries.HeadIndex; int indicesHeadIndex = m_filteredIndices.HeadIndex; while(indicesHeadIndex < m_filteredIndices.Length && m_filteredIndices[indicesHeadIndex] < Entries.HeadIndex) { ++indicesHeadIndex; } m_filteredIndices.TrimToHeadIndex(indicesHeadIndex); m_consoleView.TrimCellsToHead(indicesHeadIndex); } int entryIndex = Entries.Length - 1; int entryArrayIndex = Entries.ToArrayIndex(entryIndex); if (Apply(ref Entries.InternalArray[entryArrayIndex])) { m_filteredIndices.Add(entryIndex); m_consoleView.OnConsoleEntryAdded(console, ref entry); } }
public void TestTableLayoutSingleLongItemExactFit() { Vector2 size = new Vector2(4, 1); List<string> lines = new List<string>(); lines.Add("1111"); ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines.ToArray()); entry.Layout(this, size.x); AssertCellEntryLayout(entry, size, "1111" ); }
public override bool Apply(ref ConsoleViewCellEntry entry) { return entry.tag != null && m_tags.Contains(entry.tag); }
public void TestTableLayoutTwoItemsSingleRow() { Vector2 size = new Vector2(14, 1); string[] lines = { "111", "2222" }; ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines); entry.Layout(this, size.x); AssertCellEntryLayout(entry, size, "111 " + kSpace + "2222" ); }
public void TestTableLayoutFourItemsTwoRows() { Vector2 size = new Vector2(14, 2); string[] lines = { "1111", "2222", "3333", "4444" }; ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines); entry.Layout(this, size.x); AssertCellEntryLayout(entry, size, "1111" + kSpace + "3333" + "\n" + "2222" + kSpace + "4444" ); }
public void OnConsoleEntryAdded(AbstractConsole console, ref ConsoleViewCellEntry entry) { ReloadNewData(); Repaint(); }
public void TestTableLayoutSingleItem() { Vector2 size = new Vector2(14, 1); string[] lines = { "1111" }; ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines); entry.Layout(this, size.x); AssertCellEntryLayout(entry, size, "1111" ); }
private float HeightForTableCell(ref ConsoleViewCellEntry entry) { if (entry.width != this.ContentWidth) { entry.Layout(m_textMeasure, this.Width - UISize.ScrollBarWidth, this.ContentWidth); } return entry.height; }
public void TestTableLayoutTwoItemsDifferentSizeTwoRows() { Vector2 size = new Vector2(18, 2); List<string> lines = new List<string>(); lines.Add("1111"); lines.Add("222222"); lines.Add("33333"); ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines.ToArray()); entry.Layout(this, size.x); AssertCellEntryLayout(entry, size, "1111 " + kSpace + "33333" + "\n" + "222222" ); }
public override bool Apply(ref ConsoleViewCellEntry entry) { return(CultureInfo.CurrentCulture.CompareInfo.IndexOf(entry.value, m_text, CompareOptions.IgnoreCase) != -1); }
private void AssertCellEntryLayout(ConsoleViewCellEntry entry, Vector2 expectedSize, string expectedValue) { Assert.AreEqual(expectedValue, entry.value); Assert.AreEqual(expectedSize.x, entry.width); Assert.AreEqual(expectedSize.y, entry.height); }
public override bool Apply(ref ConsoleViewCellEntry entry) { return(entry.tag != null && m_tags.Contains(entry.tag)); }
public void Add(LogLevel level, Tag tag, string line) { ConsoleViewCellEntry entry = new ConsoleViewCellEntry(line); entry.level = level; entry.tag = tag; Add(entry); }
public override bool Apply(ref ConsoleViewCellEntry entry) { return(entry.level != null && entry.level.Priority >= m_level.Priority); }