Example #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);
 }
 protected override void OnUpdate()
 {
     // Set button status when status of connecting to ArcGIS Earth changed.
     if (ToolHelper.IsConnectSuccessfully)
     {
         Enabled = true;
     }
     else
     {
         LayersRemovedEvent.Unsubscribe(RemoveLayerFromEarth);
         Enabled   = false;
         IsChecked = false;
     }
 }
Example #3
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
     {
         LayersRemovedEvent.Unsubscribe(RemoveLayerFromEarth);
         Enabled   = false;
         IsChecked = false;
     }
 }
 protected override void OnClick()
 {
     if (IsChecked)
     {
         // Unsubscribe RemoveLayerFromEarth and set button status.
         LayersRemovedEvent.Unsubscribe(RemoveLayerFromEarth);
         IsChecked = false;
     }
     else
     {
         // Subscribe RemoveLayerFromEarth and set button status.
         LayersRemovedEvent.Subscribe(RemoveLayerFromEarth, false);
         IsChecked = true;
     }
 }
        private async Task CloseCycloMediaLayerAsync(bool closeMap)
        {
            if (!ContainsCycloMediaLayer() || closeMap)
            {
                await RemoveLayersAsync(false);
            }

            if (closeMap)
            {
                Settings settings = Settings.Instance;
                Login    login    = Login.Instance;
                LayersRemovedEvent.Unsubscribe(OnLayerRemoved);
                DrawCompleteEvent.Unsubscribe(OnDrawComplete);
                settings.PropertyChanged -= OnSettingsPropertyChanged;
                login.PropertyChanged    -= OnLoginPropertyChanged;
            }
        }
        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);
            }
        }