Beispiel #1
0
        public override Document ImportFile(string filename)
        {
            if (!File.Exists(filename))
            {
                throw new FileNotFoundException();
            }

            return(FreeMindFile.LoadFile(filename));
        }
Beispiel #2
0
        /*public override bool Export(MindMapView view, string filename)
         * {
         *  if (view.Map != null)
         *  {
         *      FreeMindFile.SaveFile(view.Map, filename);
         *      return true;
         *  }
         *
         *  return false;
         * }*/

        protected override bool ExportChartToFile(Document document, ChartPage chart, string filename)
        {
            if (chart is MindMap)
            {
                FreeMindFile.SaveFile((MindMap)chart, filename);
                return(true);
            }

            return(false);
            //return base.ExportChartToFile(document, chart, filename);
        }
Beispiel #3
0
        public void OpenDocument(string filename, bool readOnly)
        {
            BaseDocumentForm form = FindDocumentForm(filename);

            if (form != null)
            {
                SelectForm(form);
            }
            else
            {
                Cursor.Current = Cursors.WaitCursor;
                try
                {
                    Document doc = null;
                    string   ext = Path.GetExtension(filename);
                    if (ext.ToLower() == ".mm")
                    {
                        doc = FreeMindFile.LoadFile(filename);
                    }
                    else
                    {
                        doc = Document.Load(filename);
                    }

                    if (doc != null)
                    {
                        form = OpenDocument(doc, readOnly);
                        if (form != null)
                        {
                            form.Filename = filename;
                        }
                    }

                    RecentFilesManage.Default.Push(filename);
                    Cursor.Current = Cursors.Default;
                }
                catch (Exception ex)
                {
                    Cursor.Current = Cursors.Default;
                    Helper.WriteLog(ex);
                    this.ShowMessage("File name is invalid or the format is not supported", MessageBoxIcon.Error);
                }
            }
        }