private void AddItem(VDomItem item) { // TODO: Also consider shrinking it if, at the end of rendering, we're only using a small // fraction of the allocated size. if (itemsInUse == items.Length) { Array.Resize(ref items, items.Length * 2); } items[itemsInUse++] = item; }
public void AddAttribute(VDomAttribute attribute) { var value = attribute.Value; if (value is VEventHandler) { AddItem(VDomItem.Attribute(attribute.Name, (VEventHandler)value)); } else if (value is VEventAsyncHandler) { AddItem(VDomItem.Attribute(attribute.Name, (VEventAsyncHandler)value)); } else { AddItem(VDomItem.Attribute(attribute.Name, value)); } }
public void AddAttribute(string name, object value) { AddItem(VDomItem.Attribute(name, value)); }
public void OpenComponent(int sourceSeq, Component componentInstance) { openElementIndices.Push(itemsInUse); AddItem(VDomItem.Component(sourceSeq, componentInstance)); }
public void OpenComponent(int sourceSeq, string componentName) { openElementIndices.Push(itemsInUse); AddItem(VDomItem.Component(sourceSeq, componentName)); }
public void OpenElement(int sourceSeq, string tagName) { openElementIndices.Push(itemsInUse); AddItem(VDomItem.Element(sourceSeq, tagName)); }
public void AddTextNode(int sourceSeq, object text) { AddItem(VDomItem.TextNode(sourceSeq, text)); }