LynnaLab.FileParser.InsertParseableTextBefore C# (CSharp) Method

InsertParseableTextBefore() public method

public InsertParseableTextBefore ( FileComponent refComponent, string text ) : bool
refComponent FileComponent
text string
return bool
        public bool InsertParseableTextBefore(FileComponent refComponent, string[] text)
        {
            int index;
            if (refComponent == null)
                index = 0;
            else {
                index = fileStructure.IndexOf(refComponent);
                if (index == -1)
                    return false;
            }

            context = "";
            List<FileComponent> structure = new List<FileComponent>();
            List<string> structureComments = new List<string>();

            for (int i=0;i<text.Length;i++) {
                ParseLine(text[i], i, structure, structureComments);
            }

            fileStructure.InsertRange(index, structure);
            fileStructureComments.InsertRange(index, structureComments);

            return true;
        }