public void DetachElement(RadElement element) { bool containsElement = this.RemoveMappingForElement(element, false); //detach children if (this.nodes != null && this.nodes.Count > 0) { foreach (StylesheetTreeNode node in this.nodes) { if (containsElement) { foreach (RadElement child in ElementHierarchyEnumerator.TraverseElements(element, false)) { node.DetachElement(child); } } else { node.DetachElement(element); } } } else if (containsElement) { foreach (RadElement child in ElementHierarchyEnumerator.TraverseElements(element, false)) { this.parentNode.DetachElement(child); } } }
private void MapStyleNodesToElementHierarchy(MapElementContext context) { foreach (RadElement childElement in ElementHierarchyEnumerator.TraverseElements(context.attachElement)) { if (context.mappedElements.ContainsKey(childElement)) { continue; } if (!this.MapStyleNodesToElement(childElement, context)) { context.unmappedElements.Add(childElement); } } }
public void PrepareCache(RadElement rootElement) { if (this.elementClassCache == null) { this.elementClassCache = new Hashtable(); } if (this.elementTypeCache == null) { this.elementTypeCache = new Hashtable(); } foreach (RadElement element in ElementHierarchyEnumerator.TraverseElements(rootElement)) { AddElementToCache(element, this.elementClassCache, this.elementTypeCache); } }
public void AttachElementHierarchy(RadElement conditionCheckTargetElement, RadElement element) { foreach (RadElement radElement in ElementHierarchyEnumerator.TraverseElements(element)) { if (this.CheckKey(radElement)) { this.EnsureElementsCreated(); NodeElementEntry newElementEntry = this.AddElementEntry(conditionCheckTargetElement, radElement); AttachElementChildren(conditionCheckTargetElement, radElement); this.ApplyPropertySettingsOnAttachedElement(radElement); this.ManagePropetyChangeSubscription(newElementEntry, true); } } }
private void NodeMapElement(StylesheetTreeNode node, RadElement element, MapElementContext context) { if (node.Nodes == null) { return; } foreach (RadElement childElement in ElementHierarchyEnumerator.TraverseElements(element, false)) { ICollection <StylesheetTreeNode> matchingNodes = node.Nodes.FindNodes(childElement); foreach (StylesheetTreeNode childNode in matchingNodes) { NodeMapElement(childNode, childElement, context); } } node.AttachElement(element); if (context != null) { context.mappedElements[element] = null; } }