public void OnConsoleEntryAdded(CAbstractConsole console, ref CConsoleViewCellEntry entry)
        {
            CCycleArray <CConsoleViewCellEntry> 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);
            }
        }
Esempio n. 2
0
        private float HeightForTableCell(ref CConsoleViewCellEntry entry)
        {
            if (entry.width != this.ContentWidth)
            {
                entry.Layout(m_textMeasure, this.Width - CUISize.ScrollBarWidth, this.ContentWidth);
            }

            return(entry.height);
        }
Esempio n. 3
0
        public virtual void Add(CLogLevel level, CTag tag, string[] table, string stackTrace)
        {
            CConsoleViewCellEntry entry = new CConsoleViewCellEntry(table);

            entry.level      = level;
            entry.tag        = tag;
            entry.stackTrace = stackTrace;
            Add(entry);
        }
        public bool Apply(ref CConsoleViewCellEntry entry)
        {
            for (int i = 0; i < m_filters.Count; ++i)
            {
                if (!m_filters[i].Apply(ref entry))
                {
                    return(false);
                }
            }

            return(true);
        }
 internal void Add(CConsoleViewCellEntry entry)
 {
     if (CThreadUtils.IsUnityThread())
     {
         Entries.Add(entry);
         Delegate.OnConsoleEntryAdded(this, ref entry);
     }
     else
     {
         CTimerManager.ScheduleTimer(() =>
         {
             Add(entry);
         });
     }
 }
Esempio n. 6
0
        //////////////////////////////////////////////////////////////////////////////

        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");
            }
        }
Esempio n. 7
0
        //////////////////////////////////////////////////////////////////////////////

        #region IConsoleDelegate implementation

        public void OnConsoleEntryAdded(CAbstractConsole console, ref CConsoleViewCellEntry entry)
        {
            ReloadNewData();
            Repaint();
        }
 public override bool Apply(ref CConsoleViewCellEntry entry)
 {
     return(entry.level != null && entry.level.Priority >= m_level.Priority);
 }
 public override bool Apply(ref CConsoleViewCellEntry entry)
 {
     return(entry.tag != null && m_tags.Contains(entry.tag));
 }
 public override bool Apply(ref CConsoleViewCellEntry entry)
 {
     return(CultureInfo.CurrentCulture.CompareInfo.IndexOf(entry.value, m_text, CompareOptions.IgnoreCase) != -1);
 }
 public abstract bool Apply(ref CConsoleViewCellEntry entry);
Esempio n. 12
0
        //////////////////////////////////////////////////////////////////////////////

        #region IConsoleDelegate null implementation

        public void OnConsoleEntryAdded(CAbstractConsole console, ref CConsoleViewCellEntry entry)
        {
        }