Пример #1
0
 protected void setUIFromCodeRepeat(CodeRepeat cr)
 {
     this.textBoxSolutionName.Text   = codeRepeat.name;
     this.textBoxCode.Text           = codeRepeat.entryCode;
     this.checkNewGenPerLine.Checked = codeRepeat.isNewGerPerLine;
     setTabsFromEntryData(cr.entryData);
     this.dataTabControl.SelectedIndex = 0;
 }
Пример #2
0
 // Solution Change
 protected void solutionListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.solutionListBox.SelectedItem != null)
     {
         var solution = this.solutionListBox.SelectedItem.ToString();
         codeRepeat = CodeRepeaterService.LoadCodeReater(solution);
         setUIFromCodeRepeat(codeRepeat);
     }
 }
        public static string RunCodeRepeat(CodeRepeat cr)
        {
            StringBuilder strBuild = new StringBuilder();

            List <List <string> > listOfLines = cr.GetEntryDataLists();

            for (int i = 0; i < listOfLines[0].Count; i++)
            {
                var line = "";
                if (cr.isNewGerPerLine)
                {
                    foreach (string codeLine in cr.entryCode.Split('\n'))
                    {
                        line = line + codeLine.Replace(ID_SYMBOL, Guid.NewGuid().ToString()) + '\n';
                    }
                }
                else
                {
                    line = cr.entryCode.Replace(ID_SYMBOL, Guid.NewGuid().ToString());
                }
                for (int d = listOfLines.Count - 1; d > -1; d--)
                {
                    var dataId = DATA_SYMBOL + (d == 0 ? "" : d.ToString());
                    var value  = "";
                    try
                    {
                        value = listOfLines[d][i].ToString();
                    } catch (Exception e)
                    {
                        Console.WriteLine("No Data in : data" + d.ToString() + " line : " + i.ToString() + 1);
                    }

                    line = line.Replace(dataId, value);
                }
                strBuild.Append(line);
                strBuild.Append('\n');
            }
            return(strBuild.ToString());
        }
        public static void SaveCodeRepeat(CodeRepeat cr, string solutionName)
        {
            var path = Path.Combine(SettingsService.GetSolutionDirectory(), solutionName + SettingsService.SOLUTION_EXT);

            FileService.WriteOutputFile(cr.ToJson().ToString(), path);
        }
Пример #5
0
 protected void ResetCodeRepeater()
 {
     codeRepeat = new CodeRepeat();
     setUIFromCodeRepeat(codeRepeat);
 }