コード例 #1
0
 protected internal void OnLayerRemoved()
 {
     if (LayerRemoved != null)
     {
         LayerRemoved.Invoke(this, EventArgs.Empty);
     }
 }
コード例 #2
0
        /// <summary>
        /// Fires the LayerRemoved event.
        /// </summary>
        /// <param name="item">Layer that was removed.</param>
        protected virtual void OnLayerRemoved(T item)
        {
            if (EventsSuspended)
            {
                return;
            }

            LayerRemoved?.Invoke(this, new LayerEventArgs(item));
        }
コード例 #3
0
ファイル: Map.cs プロジェクト: gisvip/LightGIS
        /// <summary>
        /// 移除图层
        /// </summary>
        /// <param name="layer">图层</param>
        public void RemoveLayer(Layer layer)
        {
            int index = _Layers.IndexOf(layer);

            _Layers.Remove(layer);
            _DataSet.Tables.Remove(layer.Records);
            _TreeNode.Nodes.Remove(layer.Node);

            LayerRemoved?.Invoke(this, layer);
            MapPerformaceChanged?.Invoke(this);//重绘一级地图
        }
コード例 #4
0
        private async Task RemoveLayer(VectorLayer vectorLayer)
        {
            vectorLayer.PropertyChanged -= OnVectorLayerPropertyChanged;
            LayerRemoved?.Invoke(vectorLayer);
            await vectorLayer.DisposeAsync();

            if (Contains(vectorLayer))
            {
                Remove(vectorLayer);
            }
        }
コード例 #5
0
        /// <summary>
        /// Removes a layer that is at the specified index
        /// </summary>
        /// <param name="layerIndex">The index of the layer to remove</param>
        /// <param name="dispose">Whether to dispose of the layer that was removed</param>
        public void RemoveLayer(int layerIndex, bool dispose = true)
        {
            IFrameLayer layer = _frame.GetLayerAt(layerIndex);

            BeforeLayerRemoved?.Invoke(this, new LayerControllerLayerRemovedEventArgs(layer));

            _frame.RemoveLayerAt(layerIndex, dispose);

            // Normalize active layer
            _activeLayerIndex = ActiveLayerIndex;

            LayerRemoved?.Invoke(this, new LayerControllerLayerRemovedEventArgs(layer));
        }
コード例 #6
0
        private void btDel_Click(object Sender, System.EventArgs E)
        {
            if (selectedLayerControl == null)
            {
                return;
            }
            LayerRemoved?.Invoke(selectedLayerControl);
            int layerIndex = flpLayers.Controls.IndexOf(selectedLayerControl);

            flpLayers.Height -= selectedLayerControl.Height + 6;
            flpLayers.Controls.Remove(selectedLayerControl);
            int currentIndex = 0;

            foreach (LayerControl lc in flpLayers.Controls)
            {
                if (layerIndex <= currentIndex)
                {
                    LayerIndexChanged?.Invoke(lc.LayerName, currentIndex);
                }
                currentIndex++;
            }
            selectedLayerControl = null;
            Refresh();
        }
コード例 #7
0
 /// <summary>
 /// Occurs when removing a layer. This also fires the LayerRemoved event.
 /// </summary>
 /// <param name="sender">Sender that raised the event.</param>
 /// <param name="e">The event args.</param>
 protected virtual void OnLayerRemoved(object sender, LayerEventArgs e)
 {
     LayerRemoved?.Invoke(sender, e);
 }
コード例 #8
0
 private void OnLayerRemoved(ILayer layer)
 {
     LayerRemoved?.Invoke(layer);
 }