private void btnCreateLayer_Click(object sender, EventArgs e)
        {
            var frm = new FormLayerName("Create layer");

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                var item = new LayerItem();
                var lvi  = new ListViewItem(frm.GetValue())
                {
                    Tag = item
                };
                AddSubItems(item, lvi);
                lvLayers.Items.Add(lvi);
                btnApply.Enabled = true;
            }
        }
        private void btnCreateLayer_Click(object sender, EventArgs e)
        {
            var frm = new FormLayerName("Create layer");

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                // fire event
                StartChanging(this, new ChangingEventArgs("Create layer"));
                var layer = new LayerItem()
                {
                    Name = frm.GetValue()
                };
                _layer.Layers.Add(layer);
                Changed(this, EventArgs.Empty);
                _updating++;
                UpdateCheckListbox();
                _updating--;
            }
        }
        private void btnRenameLayer_Click(object sender, EventArgs e)
        {
            if (lvLayers.SelectedItems.Count == 0)
            {
                return;
            }
            var item = lvLayers.SelectedItems[0].Tag as LayerItem;

            if (item == null)
            {
                return;
            }
            var frm = new FormLayerName("Rename layer", lvLayers.SelectedItems[0].Text);

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                lvLayers.SelectedItems[0].Text = lvLayers.SelectedItems[0].Name = frm.GetValue();
                btnApply.Enabled = true;
            }
        }