Пример #1
0
 private void addGroup(UITagGroup group)
 {
     tagGroups.Add(group);
     panelRight.Controls.Add(group);
     if (selectedGroup == null)
     {
         selectedGroup = group;
         group.SelectedChanged(true);
     }
 }
Пример #2
0
 private void lst_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Control && e.KeyCode == Keys.A)
     {
         foreach (ImageInfo info in lst.Items)
         {
             info.Selected = true;
         }
         e.Handled          = true;
         e.SuppressKeyPress = true;
     }
     else
     {
         // standard shortcuts
         if (standardShortcuts.Checked)
         {
             foreach (var grp in tagGroups)
             {
                 grp.Shortcut_Down(e);
             }
         }
         // alt shortcuts
         else
         {
             // select group
             foreach (var grp in tagGroups)
             {
                 if (grp.SelectKey == e.KeyCode)
                 {
                     if (selectedGroup != null)
                     {
                         selectedGroup.SelectedChanged(false);
                     }
                     selectedGroup = grp;
                     grp.SelectedChanged(true);
                     e.Handled          = true;
                     e.SuppressKeyPress = true;
                     return;
                 }
             }
             // else send key to selected group
             if (selectedGroup != null)
             {
                 selectedGroup.Shortcut_Down(e);
             }
         }
     }
 }