public MidiGameBoiApp()
        {
            LogManager.ThrowConfigExceptions = true;
            LogManager.ThrowExceptions       = true;
            Logger logger = LogManager.GetLogger("LogFile");

            //logger.Info("hi");

            _appIcon    = new NotifyIcon();
            _noteViewer = new NoteViewer();

            _mainForm              = new Form1(this);
            _mainForm.FormClosing += _mainForm_FormClosing;
            _mainForm.OnSetMidi   += _mainForm_OnSetMidi;
            _mainForm.Show();

            this.MainForm = _mainForm;

            _appIcon.Icon    = SystemIcons.Question;
            _appIcon.Visible = true;

            _appIcon.DoubleClick += _appIcon_DoubleClick;

            _appIcon.ContextMenu = new ContextMenu();

            var quitItem = new MenuItem("Exit");

            quitItem.Click += delegate { _canQuit = true; _mainForm.Close(); };
            _appIcon.ContextMenu.MenuItems.Add(quitItem);

            _gameWindow = WindowUtil.FindWindowByTitle("Minecraft");
        }
Beispiel #2
0
        internal Form1(MidiGameBoiApp app)
        {
            _appIcon    = app.AppIcon;
            _noteViewer = app.NoteViewerForm;

            InitializeComponent();

            if (!System.IO.File.Exists("Data\\Binds.json"))
            {
                ConfigUtil.GenerateConfigFile();
            }
            else
            {
                ConfigUtil.LoadConfig();
            }

            if (!System.IO.File.Exists("Data\\Config.json"))
            {
                ConfigUtil.GenerateAppConfig();
            }
        }