예제 #1
0
        private void GetParams()
        {
            insertParamsDic.Clear();

            string     filePath         = txtRankFilePath.Text;
            DataFormat dataFormat       = (DataFormat)comboDataType.SelectedValue;
            string     targetSplitChars = txtTargetSplitChar.Text;
            string     rawSplitChars    = txtRawSplitChar.Text;
            bool       isCanAdd         = this.chkAdd.Checked;
            bool       isAddBefore      = this.radioAddBefore.Checked;
            bool       isAddAfter       = this.radioAddAfter.Checked;
            int        addIndex         = GetStringToIndex(this.txtAddIndex.Text) - 1;
            bool       isCanDel         = this.chkDel.Checked;
            bool       isDelBefore      = this.radioDelBefore.Checked;
            bool       isDelAfter       = this.radioDelAfter.Checked;
            int        delIndex         = GetStringToIndex(this.txtDelIndex.Text) - 1;

            #region DataType.Num

            DataInsertParams paramNum = new DataInsertParams();
            paramNum.Type             = DataType.Num;
            paramNum.RawFilePath      = filePath;
            paramNum.Format           = dataFormat;
            paramNum.TargetSplitChars = targetSplitChars;
            paramNum.RawSplitChars    = rawSplitChars;
            paramNum.IsCanAdd         = isCanAdd;
            paramNum.IsCanDel         = isCanDel;
            paramNum.IsAddBefore      = isAddBefore;
            paramNum.IsAddAfter       = isAddAfter;
            paramNum.AddIndex         = addIndex;
            paramNum.IsDelBefore      = isDelBefore;
            paramNum.IsDelAfter       = isDelAfter;
            paramNum.DelIndex         = delIndex;
            paramNum.Add3Chars        = txtNum3.Text;
            paramNum.Add4Chars        = txtNum4.Text;
            paramNum.Add5Chars        = txtNum5.Text;
            paramNum.Add6Chars        = txtNum6.Text;
            paramNum.Add7Chars        = txtNum7.Text;
            paramNum.Add8Chars        = txtNum8.Text;
            paramNum.Add9Chars        = txtNum9.Text;

            insertParamsDic.Add(DataType.Num, paramNum);

            #endregion

            #region DataType.Char

            DataInsertParams paramChar = new DataInsertParams();
            paramChar.Type             = DataType.Char;
            paramChar.RawFilePath      = filePath;
            paramChar.Format           = dataFormat;
            paramChar.TargetSplitChars = targetSplitChars;
            paramChar.RawSplitChars    = rawSplitChars;
            paramChar.IsCanAdd         = isCanAdd;
            paramChar.IsCanDel         = isCanDel;
            paramChar.IsAddBefore      = isAddBefore;
            paramChar.IsAddAfter       = isAddAfter;
            paramChar.AddIndex         = addIndex;
            paramChar.IsDelBefore      = isDelBefore;
            paramChar.IsDelAfter       = isDelAfter;
            paramChar.DelIndex         = delIndex;
            paramChar.Add3Chars        = txtChar3.Text;
            paramChar.Add4Chars        = txtChar4.Text;
            paramChar.Add5Chars        = txtChar5.Text;
            paramChar.Add6Chars        = txtChar6.Text;
            paramChar.Add7Chars        = txtChar7.Text;
            paramChar.Add8Chars        = txtChar8.Text;
            paramChar.Add9Chars        = txtChar9.Text;

            insertParamsDic.Add(DataType.Char, paramChar);

            #endregion

            #region DataType.Composite

            DataInsertParams paramComposite = new DataInsertParams();
            paramComposite.Type             = DataType.Composit;
            paramComposite.RawFilePath      = filePath;
            paramComposite.Format           = dataFormat;
            paramComposite.TargetSplitChars = targetSplitChars;
            paramComposite.RawSplitChars    = rawSplitChars;
            paramComposite.IsCanAdd         = isCanAdd;
            paramComposite.IsCanDel         = isCanDel;
            paramComposite.IsAddBefore      = isAddBefore;
            paramComposite.IsAddAfter       = isAddAfter;
            paramComposite.AddIndex         = addIndex;
            paramComposite.IsDelBefore      = isDelBefore;
            paramComposite.IsDelAfter       = isDelAfter;
            paramComposite.DelIndex         = delIndex;
            paramComposite.Add3Chars        = txtComposite3.Text;
            paramComposite.Add4Chars        = txtComposite4.Text;
            paramComposite.Add5Chars        = txtComposite5.Text;
            paramComposite.Add6Chars        = txtComposite6.Text;
            paramComposite.Add7Chars        = txtComposite7.Text;
            paramComposite.Add8Chars        = txtComposite8.Text;
            paramComposite.Add9Chars        = txtComposite9.Text;

            insertParamsDic.Add(DataType.Composit, paramComposite);

            #endregion

            #region DataType.Special

            DataInsertParams paramSpecial = new DataInsertParams();
            paramSpecial.Type             = DataType.Special;
            paramSpecial.RawFilePath      = filePath;
            paramSpecial.Format           = dataFormat;
            paramSpecial.TargetSplitChars = targetSplitChars;
            paramSpecial.RawSplitChars    = rawSplitChars;
            paramSpecial.IsCanAdd         = isCanAdd;
            paramSpecial.IsCanDel         = isCanDel;
            paramSpecial.IsAddBefore      = isAddBefore;
            paramSpecial.IsAddAfter       = isAddAfter;
            paramSpecial.AddIndex         = addIndex;
            paramSpecial.IsDelBefore      = isDelBefore;
            paramSpecial.IsDelAfter       = isDelAfter;
            paramSpecial.DelIndex         = delIndex;
            paramSpecial.AddSpecialChars  = txtSpecial.Text;
            insertParamsDic.Add(DataType.Special, paramSpecial);

            #endregion
        }
예제 #2
0
 public SpecialCharsRanker(DataInsertParams param)
 {
     this.DataParams = param;
     this.CreateOutputDirectory(this.DataParams.RawFilePath);
     this.CreateFileWriter("特殊字符");
 }
예제 #3
0
 public CompositeRanker(DataInsertParams param)
 {
     this.DataParams = param;
     this.CreateOutputDirectory(this.DataParams.RawFilePath);
     this.CreateFileWriter("字母数字混合");
 }
예제 #4
0
 public NumberRanker(DataInsertParams param)
 {
     this.DataParams = param;
     this.CreateOutputDirectory(this.DataParams.RawFilePath);
     this.CreateFileWriter("纯数字");
 }