public static IEnumerable <string> NodeNames(this DomNodeCollection source) { if (source == null) { return(Enumerable.Empty <string>()); } return(source.Select(n => n == null ? "<null>" : n.NodeName)); }
// Get the sum of the widths of the groups in this tab. // Used for scaling the Ribbon internal int GetNeededWidth() { int sum = 0; DomNodeCollection nodes = ElementInternal.ChildNodes; for (int i = 0; i < nodes.Length; i++) { sum += ((HtmlElement)nodes[i]).OffsetWidth; } return(sum); }
internal static bool IsConsolidatable(DomNodeCollection childNodes, out HxlRenderWorkElement singleton) { singleton = null; if (childNodes.Count == 0) { return(false); } foreach (var node in childNodes) { if (node.NodeType == DomNodeType.Text) { continue; } if (node is HxlTextElement) { continue; } HxlRenderWorkElement render = node as HxlRenderWorkElement; if (render != null) { if (render.ChildNodes.Count == 0) { continue; } if (singleton == null) { singleton = render; continue; } return(false); } return(false); } return(true); }
/// <summary> /// 获取所有子节点 /// </summary> public IEnumerable<IHtmlNode> Nodes() { if ( _nodeCollection == null ) _nodeCollection = new DomNodeCollection( this ); return _nodeCollection.HtmlNodes; }
/// <summary> /// 创建一个 DomFragment 实例 /// </summary> /// <param name="manager">文档碎片管理器</param> public DomFragment( DomFragmentManager manager ) { _manager = manager; _nodeCollection = new DomNodeCollection( this ); }
protected DomContainer() { // TODO Replace with linked list (performance) this.domChildNodes = new DomNodeCollection(this, new List<DomNode>()); }