AtelierElieScripter.Abstract.AbstractTextBlock.LoadTextFileBlock C# (CSharp) Метод

LoadTextFileBlock() публичный Метод

public LoadTextFileBlock ( StringReader blockStream ) : void
blockStream System.IO.StringReader
Результат void
        public virtual void LoadTextFileBlock(StringReader blockStream)
        {
            if (this.patternDivide == null)
            {
                return;
            }

            StringWriter smallerBlockStream = new StringWriter();
            string fileLine;
            StringReader blockStreamReader;

            int? lastBlock = null;

            // Loop through all lines of file
            while ((fileLine = blockStream.ReadLine()) != null)
            {
                // Dialogue Section
                Match match = Regex.Match(fileLine, this.patternDivide);

                if (match.Success)
                {

                    blockStreamReader = new StringReader(smallerBlockStream.ToString());
                    LoadTextFileSmallerBlock(blockStreamReader, lastBlock);
                    smallerBlockStream = new StringWriter();
                    lastBlock = Int32.Parse(match.Groups[1].Value);
                }

                smallerBlockStream.WriteLine(fileLine);
            }

            // Process last block
            blockStreamReader = new StringReader(smallerBlockStream.ToString());
            LoadTextFileSmallerBlock(blockStreamReader, lastBlock);
        }