Ejemplo n.º 1
0
        public static void Delete(BubbleGroup group)
        {
            lock (BubbleGroupDatabase.OperationLock)
            {
                var unifiedGroup = @group as UnifiedBubbleGroup;
                if (unifiedGroup != null)
                {
                    DeleteUnified(unifiedGroup);
                    return;
                }

                var file = BubbleGroupDatabase.GetLocation(@group);

                if (File.Exists(file))
                {
                    File.Delete(file);
                }

                BubbleGroupSync.RemoveFromSync(@group);

                BubbleGroupSync.DeleteBubbleGroupIfHasAgent(@group);

                BubbleGroupManager.BubbleGroupsRemove(@group);
            }
        }
Ejemplo n.º 2
0
        private static IEnumerable <Tuple <BubbleGroup, Stream> > OpenDatabaseStreams(List <BubbleGroup> groups)
        {
            foreach (var group in @groups)
            {
                var groupLocation = BubbleGroupDatabase.GetLocation(group);
                var stream        = File.Open(groupLocation, FileMode.Open, FileAccess.Read);

                yield return(new Tuple <BubbleGroup, Stream>(group, stream));
            }
        }