CK.Monitoring.MultiLogReader.RegisterOneLog C# (CSharp) Method

RegisterOneLog() private method

private RegisterOneLog ( RawLogFileMonitorOccurence fileOccurrence, bool newOccurrence, long streamOffset, IMulticastLogEntry log ) : LiveIndexedMonitor
fileOccurrence RawLogFileMonitorOccurence
newOccurrence bool
streamOffset long
log IMulticastLogEntry
return LiveIndexedMonitor
        LiveIndexedMonitor RegisterOneLog( RawLogFileMonitorOccurence fileOccurrence, bool newOccurrence, long streamOffset, IMulticastLogEntry log )
        {
            Debug.Assert( fileOccurrence.MonitorId == log.MonitorId );
            Debug.Assert( !newOccurrence || (fileOccurrence.FirstEntryTime == log.LogTime && fileOccurrence.LastEntryTime == log.LogTime ) );
            LiveIndexedMonitor m = _monitors.GetOrAdd( log.MonitorId, id => new LiveIndexedMonitor( id, this ) );
            m.Register( fileOccurrence, newOccurrence, streamOffset, log );
            return m;
        }

Usage Example

            void UpdateMonitor(MultiLogReader reader, long streamOffset, Dictionary <string, RawLogFileMonitorOccurence> monitorOccurrence, List <RawLogFileMonitorOccurence> monitorOccurenceList, IMulticastLogEntry log)
            {
                bool newOccurrence = false;

                if (!monitorOccurrence.TryGetValue(log.MonitorId, out RawLogFileMonitorOccurence? occ))
                {
                    occ = new RawLogFileMonitorOccurence(this, log.MonitorId, streamOffset);
                    monitorOccurrence.Add(log.MonitorId, occ);
                    monitorOccurenceList.Add(occ);
                    newOccurrence = true;
                }
                if (occ.FirstEntryTime > log.LogTime)
                {
                    occ.FirstEntryTime = log.LogTime;
                }
                if (occ.LastEntryTime < log.LogTime)
                {
                    occ.LastEntryTime = log.LogTime;
                }
                occ.LastOffset = streamOffset;
                reader.RegisterOneLog(occ, newOccurrence, streamOffset, log);
            }
All Usage Examples Of CK.Monitoring.MultiLogReader::RegisterOneLog