Пример #1
0
        private void OnScan(Session obj)
        {
            if (!obj.Encounters.Any())
            {
                ScannedContentItems.Clear();

                return;
            }

            var trie = new Trie(ContentItems.Select(x => x.Name).ToArray());

            var sessionTrieIterator = new SessionTrieIterator(obj, ContentItems);

            trie.Iterate(sessionTrieIterator);

            ScannedContentItems.ClearAndLoad(sessionTrieIterator);
        }
Пример #2
0
        public Result <FlowDocument> BuildPrintDocument(Session session)
        {
            var trie = new Trie(_contentItems.Select(x => x.Name).ToArray());

            var sessionTrieIterator = new SessionTrieIterator(session, _contentItems);

            trie.Iterate(sessionTrieIterator);

            var result = PrintSessionRequest.Build(session, sessionTrieIterator);

            if (result.IsFailure)
            {
                return(Result.Fail <FlowDocument>(result.Error));
            }

            FlowDocument flowDocument = PrintSessionFactory.Print(result.Value);

            return(Result.Ok(flowDocument));
        }