예제 #1
0
        private void OnMenuClick(object sender, RoutedEventArgs e)
        {
            switch (((WindowMenuItem)sender).Name)
            {
            case "menuEdit":
                break;

            case "menuAddLayerBoundaryLGU":
                string feedfBack = "";
                MapWindowManager.AddLGUBoundary(out feedfBack);
                if (feedfBack.Length > 0)
                {
                    System.Windows.MessageBox.Show(feedfBack, "GPX Manager", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                break;

            case "menuMapTilesSelectProvider":
                SelectTileProvider();
                break;

            case "menuClose":
                Close();
                break;

            case "menuSaveMapState":
                SaveMapState();
                break;

            case "menuAOICreate":
                var aoiw = new AOIWindow();
                aoiw.Owner = this;
                aoiw.AddNewAOI();
                aoiw.Show();
                AOIManager.AddNew();
                break;

            case "menuAOIList":
                aoiw = new AOIWindow();
                aoiw.ShowAOIList();
                aoiw.Owner = this;
                aoiw.Show();
                break;

            case "menuIslandLabels":
                break;
            }
        }
예제 #2
0
        private void OnMenuClick(object sender, RoutedEventArgs e)
        {
            switch (((WindowMenuItem)sender).Name)
            {
            case "menuCleanExtractedtracks":
                if (MapWindowManager.ExtractedTracksShapefile != null && MapWindowManager.BSCBoundaryShapefile != null)
                {
                    var result = Entities.ExtractedFishingTrackViewModel.CleanupUsingBoundary(MapWindowManager.BSCBoundaryShapefile);

                    string message = "No tracks were removed during the cleanup";
                    if (result > 0)
                    {
                        message = $"Cleanup resulted in {result} tracks removed";
                    }

                    System.Windows.Forms.MessageBox.Show(message, "GPX Manager", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    System.Windows.MessageBox.Show("Extracted track and boundary must be loaded", "GPX Manager", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                break;

            case "menuAddExtractedTracks":
                if (!MapWindowManager.AddExtractedTracksLayer())
                {
                    System.Windows.MessageBox.Show("Extracted tracks not found", "GPX Manager", MessageBoxButton.OK, MessageBoxImage.Information);
                }

                break;

            case "menuAddBSCBoundary":
                string feedfBack = "";

                if (!MapWindowManager.SetBoundaryShapefile())
                {
                    if (MapWindowManager.BSCBoundaryShapefile == null)
                    {
                        MapWindowManager.AddBSCBoundaryLineShapefile(FileOpenDialogForShapefile(), out feedfBack);
                    }
                    if (feedfBack.Length > 0)
                    {
                        System.Windows.MessageBox.Show(feedfBack, "GPX Manager", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }

                break;

            case "menuEdit":
                break;

            case "menuAddLayerBoundaryLGU":
                feedfBack = "";
                MapWindowManager.AddLGUBoundary(out feedfBack);
                if (feedfBack.Length > 0)
                {
                    System.Windows.MessageBox.Show(feedfBack, "GPX Manager", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                break;

            case "menuMapTilesSelectProvider":
                SelectTileProvider();
                break;

            case "menuClose":
                Close();
                break;

            case "menuSaveMapState":
                SaveMapState();
                break;

            case "menuAOICreate":
                var aoiw = new AOIWindow();
                aoiw.Owner = this;
                aoiw.AddNewAOI();
                aoiw.Show();
                AOIManager.AddNew();
                break;

            case "menuAOIList":
                ShowAOIList();
                break;

            case "menuIslandLabels":
                break;
            }
        }