public List <ContractOfBill> ParseContracts(ContractsRawOfBill wholeContractsRaw)
        {
            List <ContractOfBill> result = new List <ContractOfBill>();

            foreach (var contractRaw in wholeContractsRaw)
            {
                //todo
                //new task for every parsing
                ContractOfBill contract = new ContractOfBill(contractRaw.SplitWholeContractToSeparatedMainParts(parsers));

                result.Add(contract);
            }

            Info?.Invoke(this, new TextEventArgs("Разделенных контрактов: " + result.Count.ToString()));

            return(result);
        }
        public ContractsRawOfBill SplitWholeBillToSeparatedContracts()
        {
            //second variant
            //Raw Contract data
            contractRaw = new List <string>(); //the whole list of contract detalization
            bool headerOfBillFinished = false;
            //first variant
            ContractsRawOfBill wholeContractsRaw = new ContractsRawOfBill();

            foreach (var row in billDetalizationList)
            {
                //contract's Header
                if (row.StartsWith(beginningOfFirstLineOfContract))
                {
                    headerOfBillFinished = true; //Bill's header was finished

                    if (contractRaw?.Count > 2)  //if a contract already has had strings
                    {
                        wholeContractsRaw.Add(contractRaw);
                    }

                    //Start new the List 'contractRaw'  and add first row
                    contractRaw = new List <string> {
                        row
                    };
                }
                else if (row.StartsWith(stopParsing)) //After this parameter the bill has no contained contracts
                {
                    wholeContractsRaw.Add(contractRaw);

                    break;
                }
                else
                {
                    contractRaw.Add(row);   // add rows to created new the List 'contractRaw'  and add first row
                }

                if (!headerOfBillFinished)
                {
                }
            }
            Info?.Invoke(this, new TextEventArgs("контрактов с сырыми данными, шт: " + wholeContractsRaw.Count().ToString()));

            return(wholeContractsRaw);
        }