public static void SetParameter( this XElement Root, string WIdentifier, XKey key ) { XElement tag = Root.FindParameter( WIdentifier ); if ( tag != null ) { tag.SetKey( key ); } else { Root.Add( new XElement( XRegistry.WTAG, new XAttribute[] { new XAttribute( XRegistry.XID, WIdentifier ), key } ) ); } }
public static void SetParameter( this XElement Root, string WIdentifier, XKey[] keys, XParameter[] Params = null ) { XElement tag = Root.FindParameter( WIdentifier ); if ( tag != null ) { foreach ( XKey k in keys ) tag.SetKey( k ); if ( Params != null ) foreach ( XParameter P in Params ) tag.SetParameter( P ); } else { Root.Add( new XElement( XRegistry.WTAG , new XAttribute[] { new XAttribute( XRegistry.XID, WIdentifier ) } .Concat( keys ), Params ) ); } }
public void SetParameter( string WIdentifier, XKey[] keys ) { Root.SetParameter( WIdentifier, keys ); }
public void SetValue( XKey key ) { this.SetXValue( key ); }
public static void SetXValue( this XElement XRef, XKey key ) { XAttribute xa = XRef.Attribute( key.KeyName ); if ( xa != null ) { xa.Value = key.KeyValue; } else { XRef.Add( key ); } }
private static void SetKey( this XElement tag, XKey key ) { XAttribute xa = tag.Attribute( key.KeyName ); if ( xa != null ) { xa.Value = key.KeyValue; } else { tag.Add( key ); } }