Beispiel #1
0
 void rbServices_Click(object Sender, EventArgs e)
 {
     if (WebServicesDialog.ShowDialog(SearchSettings.Instance.WebServicesSettings) == DialogResult.OK)
     {
         UpdateWebServicesCaption();
     }
 }
Beispiel #2
0
        void rbServices_Click(object sender, EventArgs e)
        {
            if (_rectangleDrawing == null)
            {
                _rectangleDrawing = new RectangleDrawing((Map)App.Map);
                _rectangleDrawing.RectangleCreated += rectangleDrawing_RectangleCreated;
                _rectangleDrawing.Deactivated      += _rectangleDrawing_Deactivated;
            }

            var currentMode     = CurrentAreaSelectMode;
            var navigationMode  = App.Map.FunctionMode;
            Box rectangleExtent = null;

            if (currentMode != AreaSelectMode.DrawBox)
            {
                CurrentAreaSelectMode = AreaSelectMode.DrawBox;
                _rectangleDrawing.Activate();
                App.Map.FunctionMode = navigationMode;
            }
            else if (_searchSettings.AreaSettings.AreaRectangle != null)
            {
                rectangleExtent = Area.AreaHelper.ReprojectBoxToWGS84(_searchSettings.AreaSettings.AreaRectangle,
                                                                      _searchSettings.AreaSettings.RectangleProjection);
            }

            if (WebServicesDialog.ShowDialog(_searchSettings.WebServicesSettings,
                                             _searchSettings.CatalogSettings,
                                             _searchSettings.KeywordsSettings,
                                             App.GetExtension <IMetadataFetcherPlugin>(), App, _rectangleDrawing
                                             ) == DialogResult.OK)
            {
                UpdateWebServicesCaption();
            }

            _rectangleDrawing.Color = Color.Red;

            if (currentMode != AreaSelectMode.DrawBox)
            {
                DeactivateDrawBox();
                CurrentAreaSelectMode = currentMode;
                App.Map.FunctionMode  = navigationMode;
            }
            else if (rectangleExtent == null)
            {
                _rectangleDrawing.Deactivate();
                do_rbDrawBox_Click();
            }
            else
            {
                _rectangleDrawing.RestoreSearchRectangle(rectangleExtent.XMin, rectangleExtent.YMin, rectangleExtent.XMax, rectangleExtent.YMax);
            }
        }