Пример #1
0
        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;
        }
Пример #2
0
        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));
            }
        }
Пример #3
0
 public void AddAttribute(string name, object value)
 {
     AddItem(VDomItem.Attribute(name, value));
 }
Пример #4
0
 public void OpenComponent(int sourceSeq, Component componentInstance)
 {
     openElementIndices.Push(itemsInUse);
     AddItem(VDomItem.Component(sourceSeq, componentInstance));
 }
Пример #5
0
 public void OpenComponent(int sourceSeq, string componentName)
 {
     openElementIndices.Push(itemsInUse);
     AddItem(VDomItem.Component(sourceSeq, componentName));
 }
Пример #6
0
 public void OpenElement(int sourceSeq, string tagName)
 {
     openElementIndices.Push(itemsInUse);
     AddItem(VDomItem.Element(sourceSeq, tagName));
 }
Пример #7
0
 public void AddTextNode(int sourceSeq, object text)
 {
     AddItem(VDomItem.TextNode(sourceSeq, text));
 }