예제 #1
0
 private void EnsureElementsCreated()
 {
     if (this.mappedElements == null)
     {
         this.mappedElements = new StylesheetTreeNodeElementDictionary();
     }
 }
예제 #2
0
        private NodeElementEntry AddElementEntry(RadElement conditionCheckTargetElement, RadElement element)
        {
            if (this.mappedElements == null)
            {
                this.mappedElements = new StylesheetTreeNodeElementDictionary();
            }

            NodeElementEntry result = new NodeElementEntry(conditionCheckTargetElement, element, this);

            this.mappedElements[element] = result;

            return(result);
        }
예제 #3
0
        public void DetachElements()
        {
            if (this.mappedElements != null)
            {
                if (this.propertySettingGroups != null)
                {
                    foreach (NodeElementEntry elementEntry in this.mappedElements.Values)
                    {
                        this.ManagePropetyChangeSubscription(elementEntry, false);

                        for (int i = 0; i < this.propertySettingGroups.Count; i++)
                        {
                            foreach (IPropertySetting setting in this.propertySettingGroups[i].PropertySettings.EnumeratePropertySettingsForElement(elementEntry.Element))
                            {
                                setting.UnapplyValue(elementEntry.Element);

                                if (setting is AnimatedPropertySetting)
                                {
                                    elementEntry.Element.ResetValue(setting.Property, ValueResetFlags.Style);
                                }
                            }
                        }
                    }

                    this.propertySettingGroups.Clear();
                    this.propertySettingGroups = null;
                }

                this.mappedElements.Clear();
                this.mappedElements = null;
            }

            if (this.nodes != null)
            {
                foreach (StylesheetTreeNode node in this.nodes)
                {
                    node.DetachElements();
                }
                this.nodes.Clear();
                this.nodes = null;
            }

            this.ownerTree = null;
        }