Source/NFX/Environment/ConfigNode.cs
/// <summary>
/// Completely replaces this node's attributes, value and children with data from another node
/// </summary>
Completely replaces this node's attributes, value and children with data from another node
Completely replaces this node ' s attributes value and children with data from another node
public void ReplaceBy(IConfigSectionNode other)
        {
          if (other==null) return;  
          checkCanModify();
          Value = other.VerbatimValue;
          var ochildren = other.Children;
          var oattrs = other.Attributes;
          lock(m_Children)
          {
            m_Children.Clear();
            foreach(var ochild in ochildren)
                m_Children.Add( new ConfigSectionNode(m_Configuration, this, ochild) );
          }
          lock(m_Attributes)
          {
            m_Attributes.Clear();
            foreach(var oattr in oattrs)
                m_Attributes.Add( new ConfigAttrNode(m_Configuration, this, oattr) );
          }
          m_Modified = true;
        }
public void ReplaceBy ( IConfigSectionNode other ) { if ( other == null ) return ; checkCanModify ( ) ; Value = other . VerbatimValue ; var ochildren = other . Children ; var oattrs = other . Attributes ; lock ( m_Children ) { m_Children . Clear ( ) ; foreach ( var ochild in ochildren ) m_Children . Add ( new ConfigSectionNode ( m_Configuration , this , ochild ) ) ; } lock ( m_Attributes ) { m_Attributes . Clear ( ) ; foreach ( var oattr in oattrs ) m_Attributes . Add ( new ConfigAttrNode ( m_Configuration , this , oattr ) ) ; } m_Modified = true ; }
Completely replaces this node's attributes, value and children with data from another node
Completely replaces this node ' s attributes value and children with data from another node
//does not check for empty, as replace by empty basically deletes all children and attrs //thread safe //thread safe
other
IConfigSectionNode