예제 #1
0
 private void addButton_Click(object sender, EventArgs e)
 {
     AddLayerToThemeForm dial = new AddLayerToThemeForm();
     if (dial.ShowDialog()==DialogResult.OK)
     {
         ILayer layer = dial.SelectedLayer;
         int selIndex = listBox.SelectedIndex; // -1 if nothing selected
         int insIndex = (selIndex<0 ? 0 : selIndex);
         listBox.Items.Insert(insIndex, layer);
         listBox.SelectedItem = layer;
     }
     dial.Dispose();
 }
예제 #2
0
        private void addButton_Click(object sender, EventArgs e)
        {
            AddLayerToThemeForm dial = new AddLayerToThemeForm();

            if (dial.ShowDialog() == DialogResult.OK)
            {
                ILayer layer    = dial.SelectedLayer;
                int    selIndex = listBox.SelectedIndex; // -1 if nothing selected
                int    insIndex = (selIndex < 0 ? 0 : selIndex);
                listBox.Items.Insert(insIndex, layer);
                listBox.SelectedItem = layer;
            }
            dial.Dispose();
        }