public static SourceControl.ObjectTree GetObjectTree(string Path, ReportingServices.IReportService RS)
        {
            SourceControl.ObjectTree ot = new SourceControl.ObjectTree();

            ot.Name = Path;

            NameValueCollection reports = RS.GetItems(Path);
            foreach (string key in reports)
            {
                ot.Objects.Add(key, reports[key]);
            }

            List<string> folders = RS.GetFolders(Path);
            foreach (string folder in folders)
            {
                if (folder != "Users Folders")
                {
                    //System.Console.WriteLine("Getting ObjectTree For: " + Path + "/" + folder + "...");
                    _logger.Debug("Getting ObjectTree For: " + Path + "/" + folder + "...");
                    ot.ObjectTrees.Add(GetObjectTree(Path + "/" + folder, RS));
                }
                else
                {
                    //System.Console.WriteLine("Not Users Folders, Skipping folder: " + folder);
                    _logger.Debug("Not Users Folders, Skipping folder: " + folder);
                }
            }
            return ot;
        }
        private bool LogObjectTree(string BasePath, ObjectTree Tree, bool IsParentNew)
        {
            string fullPath = (BasePath + @"\" + Tree.Name).Replace("/", @"\").Replace(@"\\", @"\");
            bool IsThisNew = false;

            if (!Directory.Exists(fullPath))
            {
                //System.Console.WriteLine("Creating Directory: " + fullPath);
                _logger.Debug(String.Format("Creating Directory {0}",fullPath));
                Directory.CreateDirectory(fullPath);
                IsThisNew = true;
            }

            LogObjects(BasePath, Tree.Name, Tree.Objects, IsThisNew);

            foreach(ObjectTree ot in Tree.ObjectTrees)
            {
                LogObjectTree(BasePath, ot, IsThisNew);
            }

            if (IsThisNew && !IsParentNew)
            {
                //System.Console.WriteLine("Adding Folder: " + fullPath);
                _logger.Debug(String.Format("Adding Folder {0}",fullPath));
                Add(System.Text.RegularExpressions.Regex.Replace(fullPath,@"\\$",""));
            }

            return true;
        }
 public bool LogObjectTree(string BasePath, ObjectTree Tree)
 {
     return LogObjectTree(BasePath, Tree, false);
 }