Mono.Debugger.DebuggerOptions.GetSessionData C# (CSharp) Method

GetSessionData() private method

private GetSessionData ( XmlElement root ) : void
root System.Xml.XmlElement
return void
        internal void GetSessionData(XmlElement root)
        {
            XmlElement file_e = root.OwnerDocument.CreateElement ("File");
            file_e.InnerText = file;
            root.AppendChild (file_e);

            if (InferiorArgs != null) {
                foreach (string arg in InferiorArgs) {
                    XmlElement arg_e = root.OwnerDocument.CreateElement ("InferiorArgs");
                    arg_e.InnerText = arg;
                    root.AppendChild (arg_e);
                }
            }

            if (JitArguments != null) {
                foreach (string arg in JitArguments) {
                    XmlElement arg_e = root.OwnerDocument.CreateElement ("JitArguments");
                    arg_e.InnerText = arg;
                    root.AppendChild (arg_e);
                }
            }

            if (JitOptimizations != null) {
                XmlElement opt_e = root.OwnerDocument.CreateElement ("JitOptimizations");
                opt_e.InnerText = JitOptimizations;
                root.AppendChild (opt_e);
            }
            if (WorkingDirectory != null) {
                XmlElement cwd_e = root.OwnerDocument.CreateElement ("WorkingDirectory");
                cwd_e.InnerText = WorkingDirectory;
                root.AppendChild (cwd_e);
            }
            if (MonoPrefix != null) {
                XmlElement prefix_e = root.OwnerDocument.CreateElement ("MonoPrefix");
                prefix_e.InnerText = MonoPrefix;
                root.AppendChild (prefix_e);
            }
            if (MonoPath != null) {
                XmlElement path_e = root.OwnerDocument.CreateElement ("MonoPath");
                path_e.InnerText = MonoPath;
                root.AppendChild (path_e);
            }
        }

Usage Example

Example #1
0
        protected XmlDocument SaveSession()
        {
            XmlDocument doc = DebuggerConfiguration.CreateXmlDocument();

            XmlElement module_groups = doc.CreateElement("ModuleGroups");

            doc.DocumentElement.AppendChild(module_groups);

            foreach (ModuleGroup group in Config.ModuleGroups)
            {
                group.GetSessionData(module_groups);
            }

            XmlElement root = doc.CreateElement("DebuggerSession");

            root.SetAttribute("name", Name);
            doc.DocumentElement.AppendChild(root);

            XmlElement options = doc.CreateElement("Options");

            Options.GetSessionData(options);
            root.AppendChild(options);

            XmlElement modules = root.OwnerDocument.CreateElement("Modules");

            root.AppendChild(modules);

            foreach (Module module in Modules)
            {
                module.GetSessionData(modules);
            }

            XmlElement thread_groups = root.OwnerDocument.CreateElement("ThreadGroups");

            root.AppendChild(thread_groups);

            foreach (ThreadGroup group in ThreadGroups)
            {
                AddThreadGroup(thread_groups, group);
            }

            XmlElement event_list = root.OwnerDocument.CreateElement("Events");

            root.AppendChild(event_list);

            foreach (Event e in Events)
            {
                e.GetSessionData(event_list);
            }

            XmlElement display_list = root.OwnerDocument.CreateElement("Displays");

            root.AppendChild(display_list);

            foreach (Display d in Displays)
            {
                d.GetSessionData(display_list);
            }

            return(doc);
        }