private void generateProjectToolStripMenuItem_Click(object sender, EventArgs e) { if (JoyInfos.Count == 0) { ShowError("Joystick infromation is absent!", "Check error"); return; } toolStripCompileLabel.Text = CommonResources.fmMain_generateProjectToolStripMenuItem_Click_Generating____; if (!ExecuteStep(() => JoyInfos.ForEach(j => j.Check()))) { return; } if (string.IsNullOrEmpty(Settings.OutputPath)) { ShowError("Output path is not set"); return; } var gen = new CodeGenerator(__Settings, __JoyInfos, Panels.ToArray(), ExecuteStep); if (gen.GenerateProject()) { toolStripCompileLabel.Text = CommonResources.fmMain_generateProjectToolStripMenuItem_Click_Generation_successed; SetChangedState(); } }
private void generateAndUploadToolStripMenuItem_Click(object sender, EventArgs e) { if (Panels.Count(pnl => !pnl.GetModel().IsMenu) <= 0) { ShowError("There is no code to upload", "Check error"); return; } if (JoyInfos.Count == 0) { ShowError("Joystick infromation is absent!", "Check error"); return; } toolStripCompileLabel.Text = CommonResources.fmMain_generateProjectToolStripMenuItem_Click_Generating____; if (!ExecuteStep(() => JoyInfos.ForEach(j => j.Check()))) { return; } if (string.IsNullOrEmpty(Settings.OutputPath)) { ShowError("Output path is not set"); return; } var gen = new CodeGenerator(__Settings, __JoyInfos, Panels.ToArray(), ExecuteStep); if (!gen.GenerateProject()) { return; } toolStripCompileLabel.Text = CommonResources.fmMain_generateProjectToolStripMenuItem_Click_Generation_successed; SetChangedState(); var fUpload = new FlashBoardDialog429(); fUpload.ProgramCode = gen.ByteCode; fUpload.ShowDialog(this); }