Example #1
0
        /*public override bool Export(MindMapView view, string filename)
         * {
         *  string str = string.Empty;
         *
         *  if (view.Map != null && view.Map.Root != null)
         *  {
         *      TextSerializer ts = new TextSerializer();
         *      str = ts.SerializeObjects(new ChartObject[] { view.Map.Root });
         *  }
         *
         *  using (StreamWriter sw = new StreamWriter(filename, false, Encoding.Default))
         *  {
         *      sw.Write(str);
         *      sw.Close();
         *  }
         *
         *  return true;
         * }*/

        protected override bool ExportChartToFile(Document document, ChartPage chart, string filename)
        {
            string str = string.Empty;

            if (chart is MindMap)
            {
                var mindMap = (MindMap)chart;
                if (mindMap.Root != null)
                {
                    var ts = new TextSerializer();
                    str = ts.SerializeObjects(new ChartObject[] { mindMap.Root }, true);
                }

                using (var sw = new StreamWriter(filename, false, Encoding.Default))
                {
                    sw.Write(str);
                    sw.Close();
                }

                return(true);
            }

            return(false);
            //return base.ExportChartToFile(document, chart, filename);
        }
Example #2
0
        void CopyObjects(ChartObject[] mapObjects)
        {
            var obj = new DataObject();

            TextSerializer ts   = new TextSerializer();
            string         text = ts.SerializeObjects(mapObjects, Recursive);

            if (!string.IsNullOrEmpty(text))
            {
                obj.SetText(text);
            }

            if (mapObjects.Length == 1 && mapObjects[0] != null)
            {
                mapObjects[0].CopyExtendContent(obj);
            }

            obj.SetData(typeof(MapClipboardData), new MapClipboardData(mapObjects));

            Clipboard.SetDataObject(obj);
        }