Beispiel #1
0
        private void MenuItem_Export(object sender, RoutedEventArgs e)
        {
            var header = (sender as MenuItem).Header.ToString();

            if (header.Contains("DXF"))
            {
                // todo: implement dxf export
            }
            else if (header.Contains("Shapefile"))
            {
                var fbd = new FolderBrowserDialog
                {
                    Description = "Choose Shapefile folder."
                };

                if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    var exporter = new MultipleShapefileExporter(MapDataManager.LatestMap);
                    exporter.Export(fbd.SelectedPath);
                }
            }
            else if (header.Contains("Image"))
            {
                var sfd = new SaveFileDialog
                {
                    Filter = "JPEG Image (*.jpg)|*.jpg"
                };

                if (sfd.ShowDialog() == true)
                {
                    MapControl.Current.SaveImage(sfd.FileName);
                    MainDemo.TryOpenFile(sfd.FileName);
                }
            }
        }
Beispiel #2
0
        private void LoadDemo()
        {
            var demos = PluginManager.GetBuiltInPlugins();
            var name  = CityGisConfig.XValue.ElementX("Demo").AttValue("Name");

            if (demos.Any(x => x.Name == name))
            {
                var demo = demos.First(x => x.Name == name);
                LoadDemo(demo);
            }
            else
            {
                var demo = new MainDemo();
                MainWindow.DemoInstance = demo;
                demo.OnLoad();
            }
        }
Beispiel #3
0
        private void MenuItem_Import(object sender, RoutedEventArgs e)
        {
            var header = (sender as MenuItem).Header.ToString();

            if (header.Contains("DXF"))
            {
                ImportDxfMap();
            }
            else if (header.Contains("Shapefile"))
            {
                ImportShpMap();
            }
            else if (header.Contains("Bitmap"))
            {
                MainDemo demo = new MainDemo();
                demo.OpenBitmapReference();
            }
        }
Beispiel #4
0
 private void MenuItem_Topic(object sender, RoutedEventArgs e)
 {
     MainDemo.TryOpenFile("help.pdf");
 }