protected override async void Uninitialize()
        {
            await RemoveLayersAsync(true);

            MapViewInitializedEvent.Unsubscribe(OnMapViewInitialized);
            MapClosedEvent.Unsubscribe(OnMapClosedDocument);
            base.Uninitialize();
        }
 /// <summary>
 /// Called by Framework when ArcGIS Pro is closing
 /// </summary>
 /// <returns>False to prevent Pro from closing, otherwise True</returns>
 protected override bool CanUnload()
 {
     MapViewInitializedEvent.Unsubscribe(OnMapViewInitialized);
     MapMemberPropertiesChangedEvent.Unsubscribe(OnMapMemberPropertiesChanged);
     MapClosedEvent.Unsubscribe(OnMapClosed);
     //return false to ~cancel~ Application close
     return(true);
 }
 protected override bool Initialize()
 {
     //subscribe to events to determine if the procedural symbol dockpane should be visible.
     ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
     MapViewInitializedEvent.Subscribe(OnMapViewInitialized);
     MapMemberPropertiesChangedEvent.Subscribe(OnMapMemberPropertiesChanged);
     MapClosedEvent.Subscribe(OnMapClosed);
     return(base.Initialize());
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Combo Box constructor
        /// </summary>
        public ComboBoxFeatureLayer()
        {
            mappa = ProAddInSR.funzioniVariabiliGlobali.FunzioniGlobali.RicavaMappaAttiva();
            UpdateCombo();

            MapViewInitializedEvent.Subscribe(OnMapViewCaricata); // Occurs when the map view has initialized --> Cioè aperta nuova Mappa, e caricata da zero!!
            LayersAddedEvent.Subscribe(EventoLayerInTOC);
            LayersMovedEvent.Subscribe(EventoLayerInTOC);
            LayersRemovedEvent.Subscribe(EventoLayerInTOC);
            MapClosedEvent.Subscribe(AllaChiusuraMappa);
            MapPropertyChangedEvent.Subscribe(AllaVariazioneProprietaMappa); // Occurs when any property of a map is changed.
            MapMemberPropertiesChangedEvent.Subscribe(EventoLayerInTOC);     // Occurs when any property of layer or standalone table changed.
        }
Ejemplo n.º 5
0
        private void OnMapViewCaricata(MapViewEventArgs args)
        {
            funzioniVariabiliGlobali.VariabiliGlobali.blnMappaAttivaCaricata = true;
            this.Clear();
            this.UpdateCombo();

            LayersAddedEvent.Subscribe(EventoLayerInTOC);
            LayersMovedEvent.Subscribe(EventoLayerInTOC);
            LayersRemovedEvent.Subscribe(EventoLayerInTOC);
            MapClosedEvent.Subscribe(AllaChiusuraMappa);
            MapPropertyChangedEvent.Subscribe(AllaVariazioneProprietaMappa); // Occurs when any property of a map is changed.
            MapMemberPropertiesChangedEvent.Subscribe(EventoLayerInTOC);     // Occurs when any property of layer or standalone table changed.
        }
Ejemplo n.º 6
0
        public GlobeSpotter()
        {
            _agreement = Agreement.Instance;

            if (_agreement.Value)
            {
                FrameworkApplication.State.Activate("globeSpotterArcGISPro_agreementAcceptedState");
            }

            Login login = Login.Instance;

            login.Check();
            MapViewInitializedEvent.Subscribe(OnMapViewInitialized);
            MapClosedEvent.Subscribe(OnMapClosedDocument);
        }
        public StreetSmart()
        {
            _agreement = Agreement.Instance;
            _constantsRecordingLayer = ConstantsRecordingLayer.Instance;

            if (_agreement.Value)
            {
                FrameworkApplication.State.Activate("streetSmartArcGISPro_agreementAcceptedState");
            }

            Login login = Login.Instance;

            login.Check();
            MapViewInitializedEvent.Subscribe(OnMapViewInitialized);
            MapClosedEvent.Subscribe(OnMapClosedDocument);
        }
        private async Task DetectVectorLayersAsync(bool initEvents, MapView initMapView = null)
        {
            Clear();
            MapView mapView = initMapView ?? MapView.Active;
            Map     map     = mapView?.Map;
            IReadOnlyList <Layer> layers = map?.GetLayersAsFlattenedList();

            if (layers != null)
            {
                foreach (var layer in layers)
                {
                    await AddLayerAsync(layer);
                }
            }

            if (initEvents)
            {
                AddEvents();
                MapViewInitializedEvent.Subscribe(OnMapViewInitialized);
                MapClosedEvent.Subscribe(OnMapClosed);
            }
        }