Example #1
0
        private void BtAccept_Click(object sender, RoutedEventArgs e)
        {
            if (_Files == null || _Done)
            {
                Close();
                return;
            }

            foreach (var file in _Files)
            {
                var rule = file.CurrentRule;
                if (rule == null)
                {
                    file.Reason = "未处理";
                    continue;
                }

                var opt = AFileOpt.GetInstance(rule.method);
                opt.Deal(file.CurrentRule, file);
                file.Reason = "处理完成";
            }

            _Done            = true;
            BtAccept.Content = "关闭";
        }
Example #2
0
        private void MatchRule(IEnumerable <RuleDto> rules, FileDvo dto)
        {
            var list = new List <RuleDto>();
            var opt  = new AFileOpt();

            foreach (var rule in rules)
            {
                if (opt.Test(rule, dto))
                {
                    list.Add(rule);
                }
            }
            dto.OptionalList = list;
            if (list.Count == 1)
            {
                dto.CurrentRule = list[0];
            }
        }