public void InsertChild(int index, CssNode node) { node.Parent = this; children.Insert(index, node); }
public void RemoveChild(CssNode node) { node.Parent = null; children.Remove(node); }
public void AddChild(CssNode node) { node.Parent = this; children.Add(node); }
public void WriteValue(CssNode value) { if (nodeCount > 50000) throw new Exception("Greater then 50000 nodes written"); nodeCount++; switch (value.Kind) { case NodeKind.Variable : WriteVariable((CssVariable)value); break; case NodeKind.ValueList : WriteValueList((CssValueList)value); break; case NodeKind.Function : WriteFunction((CssFunction)value); break; case NodeKind.Expression : WriteValue(EvalulateExpression((CssValue)value)); break; default : writer.Write(value.ToString()); break; } }
public CssNode(NodeKind kind, CssNode parent = null) { Kind = kind; this.parent = parent; }