AtelierElieScripter.Dialogue.DialogueEntry.LoadTextFileBlock C# (CSharp) Method

LoadTextFileBlock() public method

public LoadTextFileBlock ( StringReader blockStream ) : void
blockStream System.IO.StringReader
return void
        public void LoadTextFileBlock(StringReader blockStream)
        {
            const string patternJapText = @"^\s*OLD\s*:\s*(.*)\s*$";
            const string patternEngText = @"^\s*NEW\s*:\s*(.*)\s*$";
            const string patternNotes = @"^\s*NOTES\s*:\s*(.*)\s*$";

            string searchString = blockStream.ReadToEnd();

            Match matchJapText = Regex.Match(searchString, patternJapText, RegexOptions.Multiline);
            Match matchEngText = Regex.Match(searchString, patternEngText, RegexOptions.Multiline);
            Match matchNotes = Regex.Match(searchString, patternNotes, RegexOptions.Multiline);

            if (matchJapText.Success)
            {
                if (JapText != matchJapText.Groups[1].Value)
                {
                    //UNDONE: Jap text not same error catch
                }

                JapText = matchJapText.Groups[1].Value.TrimEnd('\r', '\n');

            }

            if (matchEngText.Success)
                EngText = matchEngText.Groups[1].Value.TrimEnd('\r', '\n');

            if (matchNotes.Success)
                Notes = matchNotes.Groups[1].Value.TrimEnd('\r', '\n');
        }