Esempio n. 1
0
        private void B_Apply_Click(object sender, EventArgs e)
        {
            if (CB_FromLayer.Text == CB_ClippingLayer.Text)
            {
                MessageBox.Show("The two layers are same!", "Alarm");
                return;
            }

            //---- Show progressbar
            this.Cursor = Cursors.WaitCursor;

            VectorLayer fromLayer = _vLayers[CB_FromLayer.SelectedIndex];
            VectorLayer clipLayer = _vLayers[CB_ClippingLayer.SelectedIndex];
            bool        onlySel   = ChB_SelFeaturesOnly.Checked;
            VectorLayer newLayer  = fromLayer.Clip(clipLayer, onlySel);

            newLayer.LayerName = "Clip_" + newLayer.LayerName;
            frmMain.CurrentWin.MapDocument.ActiveMapFrame.AddLayer(newLayer);
            //frmMain.CurrentWin.MapDocument.ActiveMapFrame.MapView.PaintLayers();

            //---- Hide progressbar
            this.Cursor = Cursors.Default;
        }