Exemplo n.º 1
0
        public static void SaveProject()
        {
            XmlNode parent = Project.GetNode(Project.ProjectRootNodeName + "/shells");

            if (parent != null)
            {
                parent.RemoveAll();
                try {
                    foreach (string id in Shells.Keys)
                    {
                        Shell s = GetShell(id);
                        if (s != null)
                        {
                            if (s.MainControl.Dispatcher.CheckAccess())
                            {
                                XmlNode node = Project.GetChildNode(parent, "shell", id);
                                s.Serializer(node);
                                s.MainControl.Serializer(node, true);
                            }
                            else
                            {
                                s.MainControl.Dispatcher.Invoke((Action)(() => { s.MainControl.Serializer(parent, true); }));
                            }
                        }
                    }
                } catch (Exception) {
                }
            }
        }