Exemple #1
0
 public void Load()
 {
     XDoc             = XDocument.Load(ProfileCache.Fetch("SystemProfileXml"));
     XmlProfileHelper = new XmlProfileHelper(ProfileCache, XDoc.Root);
     XmlProfileHelper.FetchAll("Parameters");
     XmlProfileHelper.FetchAll("Directories");
     XmlProfileHelper.FetchAll("Files");
     XmlProfileHelper.FetchAll("Programs");
 }
Exemple #2
0
        public UserSetting(object parent, XElement userSetting)
            : base(parent, userSetting)
        {
            _shrink = new ShrinkDir();
            _shrink.MaxDisplayLength = 49;
            _xmlProfileHelper        = new XmlProfileHelper(ProfileCache, userSetting);
            NewBaseDir = _xmlProfileHelper.Fetch("Directories", "NewBaseDir");
            OldBaseDir = _xmlProfileHelper.Fetch("Directories", "OldBaseDir");
            KeyShrunk  = "[" + _shrink.ShrinkDirectory(NewBaseDir) + "]-[" + _shrink.ShrinkDirectory(OldBaseDir) + "]";
            string       rule     = _xmlProfileHelper.Fetch("Options", "CopyRule");
            CopyRuleEnum copyRule = CopyRuleEnum.ReplaceOnlyWithNewer;

            Enum.TryParse(rule, out copyRule);
            CopyRule           = copyRule;
            MonitoredTypesOnly = _xmlProfileHelper.FetchBool("Options", "MonitoredTypesOnly");
            string   dateThresholdText = _xmlProfileHelper.Fetch("Options", "DateThreshold");
            DateTime dateThreshold     = DateTime.MinValue;

            DateTime.TryParse(dateThresholdText, out dateThreshold);
            DateThreshold = dateThreshold;
        }