Example #1
0
        private TranslateParams GetTranslateParams()
        {
            TranslateParams translateParams = new TranslateParams();

            translateParams.FilePath      = this.txtFile.Text;
            translateParams.ModeOneParams = new ModeOneParams()
            {
                IsAddBefore    = this.cbMode1AddBefore.Checked,
                IsAddAfter     = this.cbMode1AddAfter.Checked,
                AddBeforeChars = this.txtMode1Before.Text,
                AddAfterChars  = this.txtMode1After.Text,
                AddChars       = this.txtMode1AddChar.Text
            };

            translateParams.ModeTwoParams = new ModeTwoParams()
            {
                AddChars = this.txtMode2AddChar.Text
            };

            translateParams.ModeThreeParams = new ModeThreeParams()
            {
                IsInsert = this.radioMode3Insert.Checked,
                IsDel    = this.radioMode3Del.Checked,
                Index    = Convert.ToInt32(this.txtMode3Index.Text) - 1,
                AddChars = this.txtMode3AddChar.Text
            };

            if (this.radioMode1.Checked)
            {
                translateParams.CurrentMode = TranslateMode.One;
            }

            if (this.radioMode2.Checked)
            {
                translateParams.CurrentMode = TranslateMode.Two;
            }

            if (this.radioMode3.Checked)
            {
                translateParams.CurrentMode = TranslateMode.Three;
            }

            return(translateParams);
        }
Example #2
0
 public TranslateFactory(TranslateParams translateParams)
 {
     this.TranslateParams = translateParams;
     this.FilePath        = this.TranslateParams.FilePath;
     this.LoadCurrentTranslate();
 }