private bool VerifyRemoveChild(Node node) { ModifyChildrenResult result = this.owner.CanRemoveChild(node); if (result == ModifyChildrenResult.Cancel) { return(false); } if (result == ModifyChildrenResult.Refuse) { throw new ArgumentException("Specified node may not be removed from the element"); } return(true); }
private bool VerifyAddChild(Node node) { ModifyChildrenResult result = this.owner.CanAddChild(node); if (result == ModifyChildrenResult.Cancel) { return(false); } if (result == ModifyChildrenResult.Refuse) { throw new ArgumentException("Specified node is not accepted by the element"); } if (node.parent != null) { throw new InvalidOperationException("ChildNode is already parented by a ChartElement instance."); } return(true); }