public void Add(ICodeBlock block) { if (block is CodeBlock) { CodeBlock codeBlock = block as CodeBlock; if (codeBlock.Leading == null) { this.AddRange(codeBlock.NestedBlocks); return; } } NestedBlocks.Add(block); }