Exemple #1
0
        private void UnsubscribeToEvents()
        {
            MapViewInitializedEvent.Unsubscribe(_mapOpenEvent);
            _mapOpenEvent = null;

            //MessageBox.Show("Unubscribed To Events", "MapFixer");
        }
 /// <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 async void Uninitialize()
        {
            await RemoveLayersAsync(true);

            MapViewInitializedEvent.Unsubscribe(OnMapViewInitialized);
            MapClosedEvent.Unsubscribe(OnMapClosedDocument);
            base.Uninitialize();
        }
Exemple #4
0
        public void CacheLayers(MapView view = null)
        {
            Log.Debug("Caching project layers");

            if (_token != null)
            {
                MapViewInitializedEvent.Unsubscribe(_token);
            }

            var activeView = MapView.Active ?? view;

            if (activeView == null)
            {
                Log.Debug("MapView is empty");

                return;
            }

            // Layers[FacilityModel.TableName] = LayerService.GetTable(FacilityModel.TableName, activeView.Map)
            //                                    as FeatureLayer;
        }