Exemplo n.º 1
0
        private List <CleanFolderDeleteEntry> GetConfigDeleteEntries(XmlNode cleanFolderNode)
        {
            var ret = new List <CleanFolderDeleteEntry>();

            if (cleanFolderNode == null)
            {
                return(ret);
            }
            var deleteNodes = cleanFolderNode.SelectNodes("Delete");

            if (deleteNodes == null)
            {
                return(ret);
            }

            foreach (XmlElement deleteNode in deleteNodes)
            {
                var deleteEntry = new CleanFolderDeleteEntry();
                deleteEntry.FolderPath = deleteNode.GetAttribute("folder");
                var maxAgeDays = NumberTools.GetIntOrDefault(deleteNode.GetAttribute("maxAge"), 31);
                deleteEntry.MaxAge   = new TimeSpan(maxAgeDays, 0, 0, 0);
                deleteEntry.IsActive = BoolTools.GetBoolOrDefault(deleteNode.GetAttribute("active"));
                ret.Add(deleteEntry);
            }
            return(ret);
        }
Exemplo n.º 2
0
 public CleanFolderTarget(XmlElement node)
     : this()
 {
     IsEnabled       = BoolTools.GetBoolOrDefault(node.GetAttribute("active"));
     FolderPath      = StringTools.GetValueOrDefault(node.GetAttribute("folder"));
     KeepFilesInDays = NumberTools.GetIntOrDefault(node.GetAttribute("maxAge"), 1000000);
 }