コード例 #1
0
ファイル: FormsManager.cs プロジェクト: rajeshwarn/keymapper
        public static void ToggleMappingListForm()
        {
            if (_mapListForm == null)
            {
                Properties.Settings userSettings = new Properties.Settings();

                Point formLocation = userSettings.MappingListFormLocation;
                _mapListForm = new MappingListForm();

                // Load settings before positioning so we know how wide form is
                _mapListForm.LoadUserSettings();

                if (formLocation.IsEmpty)
                {
                    PositionMappingListForm();
                }
                else
                {
                    _mapListForm.Location = formLocation;
                }

                _mapListForm.FormClosed += ChildFormClosed;

                _mapListForm.Show(_mainForm);
            }
            else
            {
                _mapListForm.Close();
            }
        }
コード例 #2
0
ファイル: FormsManager.cs プロジェクト: rajeshwarn/keymapper
 public static void ChildFormClosed(object sender, FormClosedEventArgs e)
 {
     if (sender is ColourMap)
     {
         _colourMapForm = null;
     }
     else if (sender is MappingListForm)
     {
         _mapListForm = null;
     }
     else if (sender is HelpForm)
     {
         _helpForm = null;
     }
     else if (sender is ColourEditor)
     {
         ColourEditor ce = (ColourEditor)sender;
         if (editorForms.ContainsKey(ce.Effect))
         {
             editorForms.Remove(ce.Effect);
         }
     }
     _mainForm.RegenerateMenuExternal();
 }