예제 #1
0
        public virtual bool Test(RuleDto rule, FileDvo file)
        {
            var fileMatch = !string.IsNullOrWhiteSpace(rule.src_file) ? IsMatch(file.SrcFile, rule.src_file, true) : true;
            var srcFile   = Path.Combine(file.SrcPath, file.SrcFile);
            var pathMatch = !string.IsNullOrWhiteSpace(rule.src_path) ? IsMatch(file.SrcPath + Path.DirectorySeparatorChar, rule.src_path, false) : true;

            if (fileMatch && pathMatch)
            {
                file.DstPath = rule.dst_path;
                file.DstFile = GenFileName(srcFile, rule.dst_file);
                file.DstName = System.IO.Path.Combine(file.DstPath, file.DstFile);
                return(true);
            }

            return(false);
        }
예제 #2
0
        public void Init(RuleDto dto)
        {
            _Dto = dto;
            if (_Dto == null)
            {
                _Dto = new RuleDto();
            }

            TbName.Text    = _Dto.name;
            TbSrcFile.Text = _Dto.src_file;
            TbSrcPath.Text = _Dto.src_path;
            TbDstPath.Text = _Dto.dst_path;
            TbDstFile.Text = _Dto.dst_file;

            ShowMethod();
            ShowRepeat();
        }
예제 #3
0
 public virtual void Deal(RuleDto rule, FileDvo file)
 {
 }