Source/NFX/Environment/ConfigNode.cs
/// <summary>
/// Merges attributes from another node into this one. Another node may belong to a different configuration instance
/// </summary>
Merges attributes from another node into this one. Another node may belong to a different configuration instance
Merges attributes from another node into this one . Another node may belong to a different configuration instance
public void MergeAttributes(IConfigSectionNode other, NodeOverrideRules rules = null)
        {
          if (other==null || !other.Exists) return;
          checkCanModify();
          if (rules==null) rules = NodeOverrideRules.Default;
          var oattrs = other.Attributes;
          if (other.AttrByName(rules.AttributeClearName).ValueAsBool()) this.DeleteAllAttributes();
          foreach(var oatr in oattrs)
          {
            if (oatr.IsSameName(rules.AttributeClearName))
              continue;
            var existing = this.AttrByName(oatr.Name);
            if (existing.Exists)
              existing.Value = oatr.VerbatimValue;
            else
              AddAttributeNode(oatr.Name, oatr.VerbatimValue);
          }
        }
public void MergeAttributes ( IConfigSectionNode other , NodeOverrideRules rules = null ) { if ( other == null || ! other . Exists ) return ; checkCanModify ( ) ; if ( rules == null ) rules = NodeOverrideRules . Default ; var oattrs = other . Attributes ; if ( other . AttrByName ( rules . AttributeClearName ) . ValueAsBool ( ) ) this . DeleteAllAttributes ( ) ; foreach ( var oatr in oattrs ) { if ( oatr . IsSameName ( rules . AttributeClearName ) ) continue ; var existing = this . AttrByName ( oatr . Name ) ; if ( existing . Exists ) existing . Value = oatr . VerbatimValue ; else AddAttributeNode ( oatr . Name , oatr . VerbatimValue ) ; } }
Merges attributes from another node into this one.
Merges attributes from another node into this one .
//thread safe
other
IConfigSectionNode
rules
NodeOverrideRules