private void _removeChildrenFromContainer(IReactContainerComponent container, IEnumerable <IReactComponent> children) { if (children == null) { return; } children.Apply(container.RemoveView); }
/// <summary> /// Disassociates children from container. Doesn't remove from registries. /// </summary> /// <param name="container"></param> /// <param name="atIndices"></param> /// <returns>List of removed items.</returns> private IList <IReactComponent> _childrenToRemoveFromContainer(IReactContainerComponent container, IList <long> atIndices) { if (atIndices.Count == 0 || !container.Views.Any()) { return(new List <IReactComponent>()); } var removedChildren = new List <IReactComponent>(); atIndices.Apply(index => { if (index < container.Views.Count) { removedChildren.Add(container.Views[(int)index]); } }); if (removedChildren.Count != atIndices.Count) { Debug.WriteLine("Wrong number of children removed"); } return(removedChildren); }
private void _removeChildrenFromContainer(IReactContainerComponent container, IEnumerable<IReactComponent> children) { if (children == null) { return; } children.Apply(container.RemoveView); }
/// <summary> /// Disassociates children from container. Doesn't remove from registries. /// </summary> /// <param name="container"></param> /// <param name="atIndices"></param> /// <returns>List of removed items.</returns> private IList<IReactComponent> _childrenToRemoveFromContainer(IReactContainerComponent container, IList<long> atIndices) { if (atIndices.Count == 0 || !container.Views.Any()) { return new List<IReactComponent>(); } var removedChildren = new List<IReactComponent>(); atIndices.Apply(index => { if (index < container.Views.Count) { removedChildren.Add(container.Views[(int)index]); } }); if (removedChildren.Count != atIndices.Count) { Debug.WriteLine("Wrong number of children removed"); } return removedChildren; }