Beispiel #1
0
        //public void SetFileSelect(string strFileFolder, string strFileFilter, FileSortMode fileSortBy, bool useSpecChangeFileList, string specChangeFileList) {
        //    FileSelParm.SourceFileFolder = strFileFolder;
        //    FileSelParm.FileFilter = strFileFilter;
        //    FileSelParm.FileSortBy = fileSortBy;
        //    FileSelParm.UseSpecFileList = useSpecChangeFileList;
        //    FileSelParm.SpecFileList = specChangeFileList;
        //}

        public void SetFunctionRule(FileChangeRule fileChangeBy, string fixedStr = "", bool isRegex = false, string perfixStr = "", string suffixStr = "", int startNum = 1, int wildcardLen = 2, bool onlyFixStr = false, string specChgList = "")
        {
            this.FileChangeBy   = fileChangeBy;
            this.FixedString    = fixedStr;
            this.IsRegex        = isRegex;
            this.PerfixStr      = perfixStr;
            this.SuffixStr      = suffixStr;
            this.StartSeriNum   = startNum;
            this.WildcardLen    = wildcardLen;
            this.OnlyFixStr     = onlyFixStr;
            this.SpecChangeList = specChgList;
        }
Beispiel #2
0
        private FileBatchChangeName ConstructFileBatchChangeName()
        {
            FileBatchChangeName retVal = new FileBatchChangeName();

            retVal.SetFileSelectParm(this.GetFormFileSelParm());

            FileChangeRule fileChangeBy = FileChangeRule.FixedString;

            if (rdoChgNmRulFixedStr.Checked)
            {
                fileChangeBy = FileChangeRule.FixedString;
            }
            else if (rdoChgNmRulWildcard.Checked)
            {
                fileChangeBy = FileChangeRule.Wildcard;
            }
            else if (rdoChgNmRulSpecList.Checked)
            {
                fileChangeBy = FileChangeRule.SpecList;
            }

            switch (fileChangeBy)
            {
            case FileChangeRule.FixedString:
                retVal.SetFunctionRule(fileChangeBy, txtChgNmFixedStr.Text, chkChgNmIsRegex.Checked);
                break;

            case FileChangeRule.Wildcard:
                retVal.SetFunctionRule(fileChangeBy,
                                       perfixStr: txtChgNmPerfixStr.Text,
                                       suffixStr: txtChgNmSuffixStr.Text,
                                       startNum: (int)numChgNmStartNum.Value,
                                       wildcardLen: (int)numChgNmWildcardLen.Value,
                                       onlyFixStr: chkChgNmOnlyFixStr.Checked);
                break;

            case FileChangeRule.SpecList:
                retVal.SetFunctionRule(fileChangeBy, specChgList: _fileChangeNameChangeList);
                break;
            }

            return(retVal);
        }
 //public void SetFileSelect(string strFileFolder, string strFileFilter, FileSortMode fileSortBy, bool useSpecChangeFileList, string specChangeFileList) {
 //    FileSelParm.SourceFileFolder = strFileFolder;
 //    FileSelParm.FileFilter = strFileFilter;
 //    FileSelParm.FileSortBy = fileSortBy;
 //    FileSelParm.UseSpecFileList = useSpecChangeFileList;
 //    FileSelParm.SpecFileList = specChangeFileList;
 //}
 public void SetFunctionRule(FileChangeRule fileChangeBy, string fixedStr = "", bool isRegex = false, string perfixStr = "", string suffixStr = "", int startNum = 1, int wildcardLen = 2, bool onlyFixStr = false, string specChgList = "")
 {
     this.FileChangeBy = fileChangeBy;
     this.FixedString = fixedStr;
     this.IsRegex = isRegex;
     this.PerfixStr = perfixStr;
     this.SuffixStr = suffixStr;
     this.StartSeriNum = startNum;
     this.WildcardLen = wildcardLen;
     this.OnlyFixStr = onlyFixStr;
     this.SpecChangeList = specChgList;
 }