Exemple #1
0
        protected override bool Initialize()
        {
            SetupLogging();

            FrameworkApplication.State.Deactivate(HasImplementationState);

            QueuedTask.Run(async() => {
                await CheckForLastest();

                Log.Debug("Initializing UIC Workflow Addin {version}", EvergreenSettings.CurrentVersion.AddInVersion);
            });

            if (MapView.Active == null)
            {
                _token = MapViewInitializedEvent.Subscribe(args => CacheLayers(args.MapView));
            }
            else
            {
                CacheLayers(MapView.Active);

                if (Layers.Count < 1 || Layers.Any(x => x.Value == null))
                {
                    return(false);
                }
            }

            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());
 }
Exemple #3
0
        private void SubscribeToEvents()
        {
            if (_mapOpenEvent == null)
            {
                _mapOpenEvent = MapViewInitializedEvent.Subscribe(CheckMap);
            }

            //MessageBox.Show("Subscribed To Events", "MapFixer");
        }
Exemple #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.
        }
Exemple #5
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);
            }
        }