protected override void OnClick() { try { // establish a reference to the running ArcMap instance ESRI.ArcGIS.ArcMapUI.IMxDocument mxDoc = (ESRI.ArcGIS.ArcMapUI.IMxDocument)ArcMap.Application.Document; // retrieve the TOC selected layer (if there is one) ESRI.ArcGIS.Carto.ILayer selectedLayer = mxDoc.SelectedLayer; // validate layer meets minmum requirements if (isLayerValid(selectedLayer)) { // open the upload dialog Dialogs.Interact.UploadToGoogleMapsEngine dialog = new Dialogs.Interact.UploadToGoogleMapsEngine(ref ext); dialog.Show(); } else { // display an error to the user System.Windows.Forms.MessageBox.Show("Please select a valid vector or raster layer."); } } catch (System.Exception ex) { // log an error, unable to open in dialog log.Error(ex); } }
protected override void OnClick() { try { // establish a reference to the running ArcMap instance ESRI.ArcGIS.ArcMapUI.IMxDocument mxDoc = (ESRI.ArcGIS.ArcMapUI.IMxDocument)ArcMap.Application.Document; // retrieve the TOC selected layer (if there is one) ESRI.ArcGIS.Carto.ILayer selectedLayer = mxDoc.SelectedLayer; // validate layer meets minmum requirements if (isLayerValid(selectedLayer)) { // open the upload dialog Dialogs.Interact.UploadToGoogleMapsEngine dialog = new Dialogs.Interact.UploadToGoogleMapsEngine(ref ext); dialog.Show(); } else { // display an error to the user System.Windows.Forms.MessageBox.Show("Please select a valid vector or raster layer."); } } catch (System.Exception ex) { // log an error, unable to open in dialog log.Error(ex); } }