public override Task CloseAsync()
 {
     MapSelectionChangedEvent.Unsubscribe(_mscToken);
     _mscToken = null;
     if (_mapOverlay != null)
     {
         _mapOverlay.Dispose();
     }
     return(Task.FromResult(true));
 }
        protected override void OnShow(bool isVisible)
        {
            if (isVisible && _eventToken == null) //Subscribe to event when dockpane is visible
            {
                _eventToken = MapSelectionChangedEvent.Subscribe(OnMapSelectionChangedEvent);
            }

            if (!isVisible && _eventToken != null) //Unsubscribe as the dockpane closes.
            {
                MapSelectionChangedEvent.Unsubscribe(_eventToken);
                _eventToken = null;
            }
        }
        /// <summary>
        /// ドッキングウインドウの表示/非表示でイベントを登録/解除
        /// </summary>
        protected override void OnShow(bool isVisible)
        {
            if (isVisible && _mapSelectionChangedEvent == null)
            {
                // イベントの登録
                _mapSelectionChangedEvent = MapSelectionChangedEvent.Subscribe(OnMapSelectionChanged);
            }

            if (!isVisible && _mapSelectionChangedEvent != null)
            {
                // イベントの解除
                MapSelectionChangedEvent.Unsubscribe(_mapSelectionChangedEvent);
                _mapSelectionChangedEvent = null;
            }
        }
Esempio n. 4
0
        protected override Task OnToolDeactivateAsync(bool hasMapViewChanged)
        {
            _msg.VerboseDebug("OnToolDeactivateAsync");

            MapView.Active.Map.PropertyChanged -= Map_PropertyChanged;

            MapSelectionChangedEvent.Unsubscribe(OnMapSelectionChanged);

            try
            {
                HideOptionsPane();

                return(QueuedTask.Run(() => OnToolDeactivateCore(hasMapViewChanged)));
            }
            catch (Exception e)
            {
                HandleError($"Error in tool deactivation ({Caption}): {e.Message}", e, true);
            }

            return(Task.CompletedTask);
        }
        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);
        }
Esempio n. 6
0
 public override Task CloseAsync()
 {
     MapSelectionChangedEvent.Unsubscribe(OnSelectionChanged);
     return(base.CloseAsync());
 }
Esempio n. 7
0
 protected override Task UninitializeAsync()
 {
     MapSelectionChangedEvent.Unsubscribe(FindLinkedFeatures);
     return(base.UninitializeAsync());
 }