Skip to content

Instantly share code, notes, and snippets.

@smiler
Created April 25, 2012 09:44
Show Gist options
  • Save smiler/2488568 to your computer and use it in GitHub Desktop.
Save smiler/2488568 to your computer and use it in GitHub Desktop.
SettingValue[] values = Item.GetSettingsValues();
XElement xml = new XElement( "settings",
new XAttribute( "id", Item.Id ),
from v in values
select new XElement( "setting",
new XAttribute( "name", v.Name ),
new XAttribute( "value", v.Value ),
new XAttribute( "args", v.Args ?? string.Empty ),
new XAttribute( "sortorder", v.SortOrder ) ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment