Пример #1
0
        private static BubbleGroup LoadPartiallyIfPossible(string location, Service service, string groupId, int bubblesPerGroup = 100)
        {
            using (var stream = File.Open(location, FileMode.Open, FileAccess.Read))
            {
                stream.Seek(stream.Length, SeekOrigin.Begin);

                var mostRecentVisualBubble = BubbleGroupDatabase.FetchNewestBubbleIfNotWaiting(stream, service);
                if (mostRecentVisualBubble != null)
                {
                    return(new BubbleGroup(mostRecentVisualBubble, groupId, true));
                }
            }

            var bubbles = BubbleGroupDatabase.FetchBubbles(location, service, bubblesPerGroup).Reverse().ToList();

            return(new BubbleGroup(bubbles, groupId));
        }