예제 #1
0
        public static void Export(Func <string> getProjectPath, IWin32Window window, Logger logger)
        {
            List <string> formats = new List <string>();

            formats.Add("MapSurfer.NET");
            if (MagnacartoExporter.IsReady())
            {
                formats.AddRange(new string[] { "Mapnik2", "Mapnik3", "MapServer" });
            }

            using (CartoExportFileDialog dlg = new CartoExportFileDialog(formats.ToArray()))
            {
                if (dlg.ShowDialog(window) == System.Windows.Forms.DialogResult.OK)
                {
                    ICartoExporter exporter = null;

                    switch (dlg.Format)
                    {
                    case "MapSurfer.NET":
                        exporter = new NativeFormatExporter();
                        break;

                    case "Mapnik2":
                    case "Mapnik3":
                    case "MapServer":
                        exporter = new MagnacartoExporter(dlg.Format);
                        break;
                    }

                    exporter.Export(getProjectPath(), dlg.FileName, logger);
                }
            }
        }
예제 #2
0
    public static void Export(Func<string> getProjectPath, IWin32Window window, Logger logger)
    {
      List<string> formats = new List<string>();
      formats.Add("MapSurfer.NET");
      if (MagnacartoExporter.IsReady())
        formats.AddRange(new string[] { "Mapnik2", "Mapnik3", "MapServer" });

      using (CartoExportFileDialog dlg = new CartoExportFileDialog(formats.ToArray()))
      {
        if (dlg.ShowDialog(window) == System.Windows.Forms.DialogResult.OK)
        {
          ICartoExporter exporter = null;

          switch (dlg.Format)
          {
            case "MapSurfer.NET":
              exporter = new NativeFormatExporter();
              break;
            case "Mapnik2":
            case "Mapnik3":
            case "MapServer":
              exporter = new MagnacartoExporter(dlg.Format);
              break;
          }

          exporter.Export(getProjectPath(), dlg.FileName, logger);
        }
      }
    }