public void Replace(LoveNode toReplace, LoveNode replacement) { for (int i = 0; i < Children.Count; i++) { if (Children[i] == toReplace) { Children[i] = replacement; } } }
public static LoveNodeKind GetKind(LoveNode loveNode) { var typeName = loveNode.GetType().Name; LoveNodeKind value; if (Enum.TryParse <LoveNodeKind>(typeName, out value)) { return(value); } throw new InvalidOperationException("Please Regenerate LoveNodeKind by calling LoveMvc.LoveNodeKindUtility.GenerateEnumValues() from within the LoveMvc project context and pasting those values into LoveNodeKind source code."); }