예제 #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);
                }
            }
        }
예제 #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);
                }
            }
        }
예제 #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);
            }
        }
예제 #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);
                }
            }
        }
예제 #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;
            }
        }