예제 #1
0
파일: Program.cs 프로젝트: michlG/Caloom
        private static void DeleteAllAccountAndGroupContents(bool useWorker)
        {
            var           accountIDs         = TBRAccountRoot.GetAllAccountIDs();
            var           groupIDs           = TBRGroupRoot.GetAllGroupIDs();
            List <string> referenceLocations = new List <string>();

            foreach (var accountID in accountIDs)
            {
                string referenceLocation = "acc/" + accountID + "/";
                referenceLocations.Add(referenceLocation);
            }
            foreach (var groupID in groupIDs)
            {
                string referenceLocation = "grp/" + groupID + "/";
                referenceLocations.Add(referenceLocation);
            }
            if (useWorker)
            {
                referenceLocations.ForEach(refLoc =>
                {
                    VirtualOwner owner = VirtualOwner.FigureOwner(refLoc);
                    QueueSupport.PutToOperationQueue(
                        new OperationRequest
                    {
                        DeleteOwnerContent = new DeleteOwnerContentOperation
                        {
                            ContainerName  = owner.ContainerName,
                            LocationPrefix = owner.LocationPrefix
                        }
                    }
                        );
                });
            }
            else
            {
                referenceLocations.ForEach(refLoc => StorageSupport.DeleteContentsFromOwner(refLoc));
            }
        }
예제 #2
0
 private static void DeleteOwnerContent(VirtualOwner containerOwner)
 {
     StorageSupport.DeleteContentsFromOwner(containerOwner);
 }