Rhino.NodeTransformer.AddBeforeCurrent C# (CSharp) Method

AddBeforeCurrent() private static method

private static AddBeforeCurrent ( Node parent, Node previous, Node current, Node toAdd ) : Node
parent Node
previous Node
current Node
toAdd Node
return Node
		private static Node AddBeforeCurrent(Node parent, Node previous, Node current, Node toAdd)
		{
			if (previous == null)
			{
				if (!(current == parent.GetFirstChild()))
				{
					Kit.CodeBug();
				}
				parent.AddChildToFront(toAdd);
			}
			else
			{
				if (!(current == previous.GetNext()))
				{
					Kit.CodeBug();
				}
				parent.AddChildAfter(toAdd, previous);
			}
			return toAdd;
		}