Beispiel #1
0
        private (string pageId, XDocument doc) GetCurrentPageData()
        {
            var app = new Application2();

            var w = app.Windows.CurrentWindow;

            if (w == null)
            {
                return(null, null);
            }

            app.GetPageContent(w.CurrentPageId, out var xml);

            return(w.CurrentPageId, XDocument.Parse(xml));
        }
Beispiel #2
0
        public void Save(IMindMapRoot root)
        {
            var app = new Application2();

            // Get Page
            app.GetPageContent(root.PageId, out var xml);

            if (xml == null)
            {
                return;
            }

            var doc = XDocument.Parse(xml);

            // Merge QuickStyleDefs
            var headingIndexByDepth = MergeQuickStyleDefs(doc, root);

            // Rewrite contents of first Outline
            UpdateOutline(doc, root, headingIndexByDepth);

            app.UpdatePageContent(doc.ToString(SaveOptions.OmitDuplicateNamespaces));
        }