void RefreshCore(bool isChangePath) { PathInfos.Clear(); if (string.IsNullOrEmpty(_CurrentAbsolutePath)) { PathInfos.AddRange(GetRootPathInfoViewModels <List <PathInfoViewModel> >()); } else { AddRange(PathInfos, _CurrentAbsolutePath); if (isChangePath) { if (_CurrentAbsolutePath.StartsWith(SharedInfo.ConfigDirectory) || _CurrentAbsolutePath.StartsWith(SharedInfo.PluginsDirectory)) { // 允许添加与删除的目录 IsSupportFileDelete = IsSupportFileCreate = true; } else if (_CurrentAbsolutePath.StartsWith(IOPath.CacheDirectory) || //_CurrentAbsolutePath.StartsWith(SharedInfo.HomeDirectory) || _CurrentAbsolutePath.StartsWith(IApplication.LogDirPath)) { // 允许删除的目录 IsSupportFileDelete = true; } else { IsSupportFileDelete = IsSupportFileCreate = false; } } } }
private void loadWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { var publishTimeCalculators = PathInfos .Select(p => new ObservationConfiguration(p, FindTemplate(p, Templates))) .Select(pto => new PublishTimeCalculator( pto.PathInfo, pto.StartDate, pto.Template, pto.HasCustomStartDayIndex ? pto.CustomStartDayIndex : null)) .ToList(); TemplateVideoCreator = new TemplateVideoCreator(publishTimeCalculators, PscContainer); AddVideos(Paths); }