コード例 #1
0
        private static IQuickActionFileFilter GetCreatedOnFilter(IIssueDecisionViewModel decision)
        {
            var createdOn = decision.Issue.File.FileCreatedOn.Date;

            return(new DelegateQuickActionFileFilter($"created on \"{createdOn:d}\"",
                                                     list => list.Where(x => x.Decision.Issue.File.FileCreatedOn.Date == createdOn)));
        }
コード例 #2
0
        private static IEnumerable <IQuickActionFileFilter> GetDecisionFilters(IIssueDecisionViewModel decision)
        {
            yield return(GetFileLocationFilter(decision));

            if (decision is InvalidLocationFileDecisionViewModel invalidLocationIssue)
            {
                yield return(GetTargetPathFilter(invalidLocationIssue));
            }

            yield return(GetCreatedOnFilter(decision));
        }
コード例 #3
0
        private static IQuickActionFileFilter GetFileLocationFilter(IIssueDecisionViewModel decision)
        {
            var directory        = Path.GetDirectoryName(decision.Issue.File.Filename);
            var displayDirectory = Path.GetDirectoryName(decision.Issue.File.RelativeFilename ?? decision.Issue.File.Filename);

            if (displayDirectory == string.Empty)
            {
                displayDirectory = "/";
            }

            return(new DelegateQuickActionFileFilter($"from \"{displayDirectory}\"",
                                                     list => list.Where(x => Path.GetDirectoryName(x.Decision.Issue.File.Filename) == directory)));
        }
コード例 #4
0
 public IssueDecisionWrapperViewModel(IIssueDecisionViewModel decision)
 {
     Decision         = decision;
     IsDeleteDecision = decision is DeleteFilesDecisionViewModel;
 }