public void Set(string username, UserOptions options) { /* try { resourceUploader.uploadResourceToPath(Encoding.UTF8.GetBytes(UserOptions.WriteXml(options)), "userOptions/" + username, "options.xml", true); } catch (Exception e) { Trace.TraceWarning("Uploading UserOptions failed with exception: "+e.Message); } */ }
public static string WriteXml(UserOptions options) { var stream = new MemoryStream(); new XmlSerializer(typeof(UserOptions)).Serialize(stream, options); return Encoding.UTF8.GetString(stream.ToArray()); }