Example #1
0
        private void UnwireEvents()
        {
            LayersRemovingEvent.Unsubscribe(OnLayerRemovingAsync);
            DrawCompleteEvent.Unsubscribe(OnDrawCompleted);

            ProjectOpenedAsyncEvent.Unsubscribe(OnProjectOpendedAsync);
            ProjectSavingEvent.Unsubscribe(OnProjectSavingAsync);
        }
Example #2
0
        private void UnwireEvents()
        {
            //MapViewInitializedEvent.Unsubscribe(OnMapViewInitialized);
            LayersRemovingEvent.Unsubscribe(OnLayerRemovingAsync);
            DrawCompleteEvent.Unsubscribe(OnDrawCompleted);

            ProjectOpenedAsyncEvent.Unsubscribe(OnProjectOpendedAsync);
            ProjectSavingEvent.Unsubscribe(OnProjectSavingAsync);

            ProjectItemsChangedEvent.Unsubscribe(OnProjectItemsChanged);
            ProjectItemRemovingEvent.Unsubscribe(OnProjectItemRemoving);

            MapMemberPropertiesChangedEvent.Unsubscribe(OnMapMemberPropertiesChanged);
        }
        private void RestartGlobeSpotter()
        {
            if (_api == null || _api.GetAPIReadyState())
            {
                DrawCompleteEvent.Unsubscribe(OnDrawComplete);
                _measurementList.Api = null;
                DockPaneGlobeSpotter globeSpotter = (dynamic)DataContext;
                globeSpotter.PropertyChanged          -= OnGlobeSpotterPropertyChanged;
                _settings.PropertyChanged             -= OnSettingsPropertyChanged;
                _cycloMediaGroupLayer.PropertyChanged -= OnGroupLayerPropertyChanged;
                _measurementList.RemoveAll();

                _vectorLayerList.LayerAdded   -= OnAddVectorLayer;
                _vectorLayerList.LayerRemoved -= OnRemoveVectorLayer;
                _vectorLayerList.LayerUpdated -= OnUpdateVectorLayer;

                foreach (var vectorLayer in _vectorLayerList)
                {
                    vectorLayer.PropertyChanged -= OnVectorLayerPropertyChanged;
                }

                foreach (var vectorLayer in _vectorLayerList)
                {
                    uint?vectorLayerId = vectorLayer.LayerId;

                    if (vectorLayerId != null)
                    {
                        _api?.RemoveLayer((uint)vectorLayerId);
                        vectorLayer.LayerId = null;
                    }
                }

                _viewerList.RemoveViewers();

                if (_api != null && _api.GetAPIReadyState())
                {
                    int[] viewerIds = _api.GetViewerIDs();

                    foreach (int viewerId in viewerIds)
                    {
                        _api.CloseImage((uint)viewerId);
                    }

                    RemoveApi();
                }

                Initialize();
            }
        }
        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);
            }
        }
        public async Task DisposeAsync()
        {
            await QueuedTask.Run(() =>
            {
                if (_rowChanged != null)
                {
                    RowChangedEvent.Unsubscribe(_rowChanged);
                }

                if (_rowDeleted != null)
                {
                    RowDeletedEvent.Unsubscribe(_rowDeleted);
                }

                if (_rowCreated != null)
                {
                    RowCreatedEvent.Unsubscribe(_rowCreated);
                }
            });

            MapSelectionChangedEvent.Unsubscribe(OnMapSelectionChanged);
            DrawCompleteEvent.Unsubscribe(OnDrawCompleted);
        }