private void Parse() { var blocks = new List <CodeBlock>(); foreach (var block in GetCodeBlocks()) { switch (block.Type) { case ".assembly": var assembly = AssemblyBlock.Parse(block); blocks.Add(assembly); break; case ".class": var clazz = ClassBlock.Parse(block); blocks.Add(clazz); break; default: blocks.Add(block); break; } } Blocks = blocks; }
public void AddAssembly(AssemblyBlock assembly) { var index = Blocks.FindLastIndex(block => block is AssemblyBlock); Blocks.Insert(index + 1, assembly); }