Пример #1
0
        public StateInspectorOutput(LogSourcePostprocessorDeserializationParams p, ILogPartTokenFactories rotatedLogPartFactories)
        {
            this.logSource = p.LogSource;

            if (!p.Reader.ReadToFollowing("root"))
            {
                throw new FormatException();
            }
            etag.Read(p.Reader);

            var eventsDeserializer = new EventsDeserializer(TextLogEventTrigger.DeserializerFunction);

            foreach (var elt in p.Reader.ReadChildrenElements())
            {
                if (eventsDeserializer.TryDeserialize(elt, out var evt))
                {
                    events.Add(evt);
                }
                else if (rotatedLogPartFactories.TryReadLogPartToken(elt, out var tmp))
                {
                    this.rotatedLogPartToken = tmp;
                }
                p.Cancellation.ThrowIfCancellationRequested();
            }
        }
Пример #2
0
        public StateInspectorOutput(XDocument doc, ILogSource logSource, ILogPartTokenFactory rotatedLogPartFactory = null)
        {
            this.logSource = logSource;
            var eventsDeserializer = new EventsDeserializer(TextLogEventTrigger.DeserializerFunction);

            this.events = eventsDeserializer
                          .Deserialize(doc.Root)
                          .ToList();
            this.rotatedLogPartToken = rotatedLogPartFactory.SafeDeserializeLogPartToken(doc.Root);
        }
Пример #3
0
        public SequenceDiagramPostprocessorOutput(LogSourcePostprocessorDeserializationParams p, ILogPartTokenFactory rotatedLogPartFactory)
        {
            this.logSource = p.LogSource;
            var reader = p.Reader;

            events              = new List <M.Event>();
            timelineComments    = new List <TLBlock.Event>();
            stateComments       = new List <SIBlock.Event>();
            rotatedLogPartToken = new NullLogPartToken();

            if (!reader.ReadToFollowing("root"))
            {
                throw new FormatException();
            }
            etag.Read(reader);

            if (reader.ReadToFollowing(messagingEventsElementName))
            {
                var eventsDeserializer = new M.EventsDeserializer(TextLogEventTrigger.DeserializerFunction);
                foreach (var elt in reader.ReadChildrenElements())
                {
                    if (eventsDeserializer.TryDeserialize(elt, out var evt))
                    {
                        events.Add(evt);
                    }
                }
            }
            if (reader.ReadToFollowing(timelineCommentsElementName))
            {
                var eventsDeserializer = new TLBlock.EventsDeserializer(TextLogEventTrigger.DeserializerFunction);
                foreach (var elt in reader.ReadChildrenElements())
                {
                    if (eventsDeserializer.TryDeserialize(elt, out var evt))
                    {
                        timelineComments.Add(evt);
                    }
                }
            }
            if (reader.ReadToFollowing(stateCommentsElementName))
            {
                var eventsDeserializer = new SIBlock.EventsDeserializer(TextLogEventTrigger.DeserializerFunction);
                foreach (var elt in reader.ReadChildrenElements())
                {
                    if (eventsDeserializer.TryDeserialize(elt, out var evt))
                    {
                        stateComments.Add(evt);
                    }
                }
            }
        }