public void ReplaceBy(Statement other) { Block block = (Block)ParentNode; if (null == block) { throw new InvalidOperationException(); } block.Statements.Replace(this, other); }