コード例 #1
0
ファイル: LayersToolbar.cs プロジェクト: hgabor/kfirpgcreator
 internal new void Load(Map currentMap)
 {
     checkedListBox.Items.Clear();
     for (int l = currentMap.layerGroups.Count - 1; l >= 0; --l) {
         checkedListBox.Items.Add(currentMap.layerGroups[l].Name, true);
     }
     checkedListBox.SelectedIndex = 0;
 }
コード例 #2
0
 private SelectTwoLayersDialog(bool different, Map map)
 {
     InitializeComponent();
     foreach (var layer in map.SimpleLayerGroups) {
         baseListBox.Items.Add(layer);
         topListBox.Items.Add(layer);
     }
     if (different) {
         okButton.Click += (sender, args) => {
             if (baseListBox.SelectedItem == topListBox.SelectedItem) {
                 MessageBox.Show(this, "You must select different layers!");
             }
             else {
                 DialogResult = DialogResult.OK;
             }
         };
     }
     else {
         okButton.DialogResult = DialogResult.OK;
     }
 }
コード例 #3
0
 public static bool SelectTwoLayers(Map map, ref Layer layer1, ref Layer layer2)
 {
     using (SelectTwoLayersDialog form = new SelectTwoLayersDialog(false, map)) {
         return SelectLayers(form, ref layer1, ref layer2);
     }
 }