Пример #1
0
        private void btnRemoveFeatures_Click(object sender, EventArgs e)
        {
            if (_layerName == null)
            {
                return;
            }
            if (listView1.SelectedIndices.Count == 0)
            {
                return;
            }
            ILabelLayer lyr = GetLabelLayer((_activeViewer as ICurrentRasterInteractiver), _layerName, null);

            if (lyr == null)
            {
                return;
            }
            for (int i = listView1.SelectedItems.Count - 1; i >= 0; i--)
            {
                lyr.RemoveFeature(listView1.SelectedItems[i].Tag as Feature);
                if (RemoveFeature != null)
                {
                    RemoveFeature(listView1.SelectedItems[i].Tag as Feature);
                }
                listView1.Items.Remove(listView1.SelectedItems[i]);
            }
            _activeViewer.Canvas.Refresh(enumRefreshType.VectorLayer);
        }
Пример #2
0
        private void btnRemoveFeatures_Click(object sender, EventArgs e)
        {
            if (_layerName == null)
            {
                return;
            }
            if (listView1.SelectedIndices.Count == 0)
            {
                return;
            }
            ILabelLayer lyr = FindLabelLayer(_layerName);

            if (lyr != null)
            {
                for (int i = listView1.SelectedItems.Count - 1; i >= 0; i--)
                {
                    lyr.RemoveFeature(listView1.SelectedItems[i].Tag as Feature);
                    if (RemoveFeature != null)
                    {
                        RemoveFeature(listView1.SelectedItems[i].Tag as Feature);
                    }
                    RemoveFeatureToDic(listView1.SelectedItems[i].Tag as Feature);
                    listView1.Items.Remove(listView1.SelectedItems[i]);
                }
            }
        }
Пример #3
0
 private void InitItems()
 {
     if (listView1.Items.Count != 0)
     {
         OID = 0;
         ILabelLayer lyr = GetLabelLayer((_activeViewer as ICurrentRasterInteractiver), _layerName, null);
         if (lyr == null)
         {
             return;
         }
         for (int i = listView1.Items.Count - 1; i >= 0; i--)
         {
             lyr.RemoveFeature(listView1.Items[i].Tag as Feature);
             if (RemoveFeature != null)
             {
                 RemoveFeature(listView1.Items[i].Tag as Feature);
             }
         }
         listView1.Items.Clear();
     }
     _activeViewer.Canvas.Refresh(enumRefreshType.VectorLayer);
 }
Пример #4
0
 private void InitFeature()
 {
     if (listView1.Items.Count != 0)
     {
         OID = 0;
         ILabelLayer lyr = GetLabelLayer((_activeViewer as ICurrentRasterInteractiver), _layerName, null);
         if (lyr == null)
         {
             return;
         }
         for (int i = listView1.Items.Count - 1; i >= 0; i--)
         {
             lyr.RemoveFeature(listView1.Items[i].Tag as Feature);
             if (RemoveFeature != null)
             {
                 RemoveFeature(listView1.Items[i].Tag as Feature);
             }
         }
         listView1.Items.Clear();
     }
     (_activeViewer as ICurrentRasterInteractiver).LabelService.Reset();
     _activeViewer.Canvas.CurrentViewControl = new DefaultControlLayer();
 }
Пример #5
0
 private void ClearFeature(ICanvasViewer cv)
 {
     if (listView1.Items.Count != 0)
     {
         OID = 0;
         ILabelLayer lyr = GetLabelLayer((cv as ICurrentRasterInteractiver), _layerName, null);
         if (lyr == null)
         {
             return;
         }
         for (int i = listView1.Items.Count - 1; i >= 0; i--)
         {
             lyr.RemoveFeature(listView1.Items[i].Tag as Feature);
             if (RemoveFeature != null)
             {
                 RemoveFeature(listView1.Items[i].Tag as Feature);
             }
         }
         listView1.Items.Clear();
     }
     (cv as ICurrentRasterInteractiver).LabelService.Reset();
     cv.Canvas.CurrentViewControl = new DefaultControlLayer();
     cv.Canvas.Refresh(enumRefreshType.VectorLayer);
 }