private void RemoveRange(int index, int count) { while (count > 0) { count--; _blocks.RemoveAt(index); } }
private static DefinitionList GetCurrentDefinitionList(ParagraphBlock paragraphBlock, ContainerBlock previousParent) { var index = previousParent.IndexOf(paragraphBlock) - 1; if (index < 0) { return(null); } var lastBlock = previousParent[index]; if (lastBlock is BlankLineBlock) { lastBlock = previousParent[index - 1]; previousParent.RemoveAt(index); } return(lastBlock as DefinitionList); }
/// <summary> /// Closes a <typeparamref name="TProxy"/>. /// </summary> /// <param name="blockProcessor">The <see cref="BlockProcessor"/> processing the <typeparamref name="TProxy"/> to close. Never <c>null</c>.</param> /// <param name="block">The <typeparamref name="TProxy"/> to close. Never <c>null</c>.</param> /// <returns>False if the block should be discarded, true otherwise.</returns> protected sealed override bool CloseBlock(BlockProcessor blockProcessor, TProxy block) { TMain proxyReplacement = CloseProxy(blockProcessor, block); if (proxyReplacement == null) { return(false); } ContainerBlock parent = block.Parent; // TODO inefficient int index = parent.IndexOf(block); parent.RemoveAt(index); parent.Insert(index, proxyReplacement); return(true); }