Beispiel #1
0
 /// <summary>
 /// Funzione da richiamare allo scattare dell'evento 'Chiusura Mappa'.
 /// </summary>
 /// <param name="args"></param>
 private void AllaChiusuraMappa(MapClosedEventArgs args)
 {
     this.Clear();
     this.UpdateCombo();
     LayersAddedEvent.Unsubscribe(EventoLayerInTOC);
     LayersMovedEvent.Unsubscribe(EventoLayerInTOC);
     LayersRemovedEvent.Unsubscribe(EventoLayerInTOC);
     //MapPropertyChangedEvent.Unsubscribe(AllaVariazioneProprietaMappa); // Occurs when any property of a map is changed.
     MapMemberPropertiesChangedEvent.Unsubscribe(EventoLayerInTOC);
 }
Beispiel #2
0
 protected override void OnUpdate()
 {
     // Set button status when status of ArcGIS Earth or ArcGIS Pro changed.
     if (ToolHelper.IsArcGISEarthRunning && ToolHelper.IsArcGISProGlobalSceneOpening)
     {
         Enabled = true;
     }
     else
     {
         // Unsubscribe events of adding layer and elevation source.
         LayersAddedEvent.Unsubscribe(AddLayerToEarth);
         Enabled   = false;
         IsChecked = false;
     }
 }
Beispiel #3
0
 protected override void OnClick()
 {
     if (IsChecked)
     {
         // Unsubscribe events of adding layer and elevation source.
         LayersAddedEvent.Unsubscribe(AddLayerToEarth);
         IsChecked = false;
     }
     else
     {
         // Subscribe events of adding layer and elevation source.
         LayersAddedEvent.Subscribe(AddLayerToEarth, false);
         IsChecked = true;
     }
 }
 protected override void OnUpdate()
 {
     // Set button status when status of connecting to ArcGIS Earth changed.
     if (ToolHelper.IsConnectSuccessfully)
     {
         Enabled = true;
     }
     else
     {
         // Unsubscribe events of adding layer and elevation source.
         LayersAddedEvent.Unsubscribe(AddLayerToEarth);
         Enabled   = false;
         IsChecked = false;
     }
 }
        private async void OnMapClosed(MapClosedEventArgs args)
        {
            LayersAddedEvent.Unsubscribe(OnLayersAdded);
            LayersMovedEvent.Unsubscribe(OnLayersMoved);
            LayersRemovedEvent.Unsubscribe(OnLayersRemoved);
            MapMemberPropertiesChangedEvent.Unsubscribe(OnMapMemberPropertiesChanged);
            TOCSelectionChangedEvent.Unsubscribe(OnTocSelectionChanged);
            ActiveToolChangedEvent.Unsubscribe(OnActiveToolChangedEvent);
            EditCompletedEvent.Unsubscribe(OnEditCompleted);
            DrawCompleteEvent.Unsubscribe(OnDrawCompleted);
            DrawStartedEvent.Unsubscribe(OnDrawStarted);

            while (Count >= 1)
            {
                VectorLayer vectorLayer = this[0];
                await RemoveLayer(vectorLayer);
            }
        }