Esempio n. 1
0
        public void BuildingBlock(string[] massline, ProductMenager workFile, ParserSetup parser, AccountHandler Notify)
        {
            string[,] mainmass = new string[countLine, countColumns];
            int LineNumber   = 0;
            int ColumnNumber = 0;

            try
            {
                if (massline.Any(x => x == null) == true)
                {
                    return;
                }
                for (int i = 0; i < massline.Length; i++)
                {
                    if (ColumnNumber != Convert.ToInt32(countColumns))
                    {
                        StringConversion(massline[i], LineNumber, ColumnNumber, mainmass);
                        if (LineNumber == Convert.ToInt32(countLine) - 1)
                        {
                            LineNumber = 0;
                            ColumnNumber++;
                        }
                        else
                        {
                            LineNumber++;
                        }
                    }
                    else
                    {
                        LineNumber   = 0;
                        ColumnNumber = 0;
                    }
                }

                string[] finmass = new string[mainmass.GetLength(0)];
                for (int j = 0; j < mainmass.GetLength(0); j++)
                {
                    for (int z = 0; z < mainmass.GetLength(1); z++)
                    {
                        finmass[j] += mainmass[j, z];
                        if (mainmass.GetLength(1) - 1 != z)
                        {
                            finmass[j] += "|";
                        }
                        finmass[j] += "   ";
                    }
                }
                lock (lockerW)
                {
                    workFile.WriteTitle();
                    workFile.WriteLineMass(finmass);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.StackTrace);
                Notify?.Invoke();
            }
        }
Esempio n. 2
0
 public ParserSettings(string path, int NumberLines, int MainColumns, string pathRez, string title, string formatting, ParserSetup parser, bool titleblok, int pack, int numberLength)
 {
     Path         = path;
     CountLine    = NumberLines;
     CountColumns = MainColumns;
     PathRez      = pathRez;
     Title        = title;
     Formatting   = formatting;
     Parser       = parser;
     TitleBlok    = titleblok;
     Pack         = pack;
     NumberLength = numberLength;
 }