Esempio n. 1
0
 void ResetInternal()
 {
     if (propertyValue != null)
     {
         propertyValue.RemoveNodeFromParent();
         propertyValue.ParentProperty = null;
         propertyValue = null;
     }
     if (_propertyElement != null)
     {
         _propertyElement.ParentNode.RemoveChild(_propertyElement);
         _propertyElement = null;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// used internally by the XamlParser.
 /// Add a collection element that already is part of the XML DOM.
 /// </summary>
 internal void ParserAddCollectionElement(XmlElement collectionPropertyElement, XamlPropertyValue val)
 {
     if (collectionPropertyElement != null && _propertyElement == null)
     {
         ParserSetPropertyElement(collectionPropertyElement);
     }
     collectionElements.AddInternal(val);
     val.ParentProperty = this;
     if (collectionPropertyElement != _propertyElement)
     {
         val.RemoveNodeFromParent();
         val.AddNodeTo(this);
     }
 }
Esempio n. 3
0
        void ResetInternal()
        {
            bool isExplicitCollection = false;

            if (propertyValue != null)
            {
                isExplicitCollection = IsCollection;

                propertyValue.RemoveNodeFromParent();
                propertyValue.ParentProperty = null;
                propertyValue = null;
            }
            if (_propertyElement != null)
            {
                Debug.Assert(!isExplicitCollection || _propertyElement.ParentNode == null);

                if (!isExplicitCollection)
                {
                    _propertyElement.ParentNode.RemoveChild(_propertyElement);
                }
                _propertyElement = null;
            }
        }
Esempio n. 4
0
		/// <summary>
		/// used internally by the XamlParser.
		/// Add a collection element that already is part of the XML DOM.
		/// </summary>
		internal void ParserAddCollectionElement(XmlElement collectionPropertyElement, XamlPropertyValue val)
		{
			if (collectionPropertyElement != null && _propertyElement == null) {
				ParserSetPropertyElement(collectionPropertyElement);
			}
			collectionElements.AddInternal(val);
			val.ParentProperty = this;
			if (collectionPropertyElement != _propertyElement) {
				val.RemoveNodeFromParent();
				val.AddNodeTo(this);
			}
		}