示例#1
0
        void LogcatProcess_OnLineOutputReceive(string line)
        {
            if (line == "DEVCON")
            {
                if (OnDeviceConnected != null)
                {
                    OnDeviceConnected();
                }

                return;
            }

            LogEntry entry          = LogEntry.Parse(line);
            bool     IsGeneralEntry = true;

            Slots.Iterate(delegate(FilteredLogSlot slot)
            {
                if (slot.TryAdd(entry))
                {
                    IsGeneralEntry = false;
                    return(true);
                }

                IsGeneralEntry = true;
                return(false);
            });



            if (IsGeneralEntry)
            {
                GeneralEntries.AddEntry(entry);

                if (GeneralTabUi.InvokeRequired)
                {
                    GeneralTabUi.Invoke(new System.Windows.Forms.MethodInvoker(delegate()
                    {
                        GeneralTabUi.WriteLog(entry);
                    }));
                }
            }
        }
示例#2
0
        public bool TryAdd(LogEntry entry)
        {
            CheckDisposed();

            if (SlotFilters.Match(entry))
            {
                if (Ui.InvokeRequired)
                {
                    Ui.Invoke(new System.Windows.Forms.MethodInvoker(delegate()
                    {
                        Ui.WriteLog(entry);
                    }));
                }

                FilteredList.AddEntry(entry);
                return(true);
            }

            return(false);
        }