Esempio n. 1
0
        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);
                }
            }
        }
Esempio n. 2
0
        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);
                }
            }
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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);
                }
            }
        }
Esempio n. 5
0
        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;
            }
        }