void SaveConfigurationToStream(string filename)
{
using (FileStream stream = new FileStream (filename, FileMode.Create)) {
XmlDocument doc = CreateXmlDocument ();
XmlElement element = doc.CreateElement ("Configuration");
doc.DocumentElement.AppendChild (element);
XmlElement load_native_symtabs_e = doc.CreateElement ("LoadNativeSymtabs");
load_native_symtabs_e.InnerText = LoadNativeSymtabs ? "true" : "false";
element.AppendChild (load_native_symtabs_e);
XmlElement follow_fork_e = doc.CreateElement ("FollowFork");
follow_fork_e.InnerText = FollowFork ? "true" : "false";
element.AppendChild (follow_fork_e);
XmlElement opaque_file_names_e = doc.CreateElement ("OpaqueFileNames");
opaque_file_names_e.InnerText = OpaqueFileNames ? "true" : "false";
element.AppendChild (opaque_file_names_e);
XmlElement stop_on_signals_e = doc.CreateElement ("StopOnManagedSignals");
stop_on_signals_e.InnerText = StopOnManagedSignals ? "true" : "false";
element.AppendChild (stop_on_signals_e);
XmlElement nested_break_states_e = doc.CreateElement ("NestedBreakStates");
nested_break_states_e.InnerText = NestedBreakStates ? "true" : "false";
element.AppendChild (nested_break_states_e);
XmlElement redirect_output_e = doc.CreateElement ("RedirectOutput");
redirect_output_e.InnerText = RedirectOutput ? "true" : "false";
element.AppendChild (redirect_output_e);
XmlElement stop_daemon_threads_e = doc.CreateElement ("StopDaemonThreads");
stop_daemon_threads_e.InnerText = (ThreadingModel & ThreadingModel.StopDaemonThreads) != 0 ? "true" : "false";
element.AppendChild (stop_daemon_threads_e);
XmlElement stop_immutable_threads_e = doc.CreateElement ("StopImmutableThreads");
stop_immutable_threads_e.InnerText = (ThreadingModel & ThreadingModel.StopImmutableThreads) != 0 ? "true" : "false";
element.AppendChild (stop_immutable_threads_e);
XmlElement threading_model_e = doc.CreateElement ("ThreadingModel");
switch (threading_model & ThreadingModel.ThreadingMode) {
case ThreadingModel.Single:
threading_model_e.InnerText = "single";
break;
case ThreadingModel.Process:
threading_model_e.InnerText = "process";
break;
case ThreadingModel.Global:
threading_model_e.InnerText = "global";
break;
default:
threading_model_e.InnerText = "default";
break;
}
element.AppendChild (threading_model_e);
XmlElement user_notifications_e = doc.CreateElement ("UserNotifications");
if ((user_notifications & UserNotificationType.Threads) != 0)
user_notifications_e.InnerText = "+threads";
else
user_notifications_e.InnerText = "-threads";
element.AppendChild (user_notifications_e);
XmlElement module_groups = doc.CreateElement ("ModuleGroups");
doc.DocumentElement.AppendChild (module_groups);
foreach (ModuleGroup group in ModuleGroups)
group.GetSessionData (module_groups);
doc.Save (stream);
}
}