Exemple #1
0
        private void mnuMicrocontrollerBuild_Click(object sender, EventArgs e)
        {
            if (!IsProjectFormOpen())
            {
                return;
            }

            if (!SureToWritePasswordToLadderOrAbort())
            {
                return;
            }

            try
            {
                ExecutableGeneratorServices executableGeneratorServices = new ExecutableGeneratorServices();
                executableGeneratorServices.GenerateExecutable(projectForm.Program, mnuMicrocontrollerLadderSaveInsideMic.Checked, mnuMicrocontrollerLadderAskPasswordToRead.Checked, confirmedPassword, false);
                if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\" + projectForm.Program.Name.Replace(' ', '_') + ".a43"))
                {
                    File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\" + projectForm.Program.Name.Replace(' ', '_') + ".a43");
                }

                File.Move(Application.StartupPath + @"\" + projectForm.Program.Name.Replace(' ', '_') + ".a43", Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\" + projectForm.Program.Name.Replace(' ', '_') + ".a43");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Write Executable");
            }
            lblStatusBar.Text = "Build succeeded";
        }
Exemple #2
0
        private void mnuMicrocontrollerCommunicationDownload_Click(object sender, EventArgs e)
        {
            if (!IsProjectFormOpen())
            {
                return;
            }

            if (!SureToWritePasswordToLadderOrAbort())
            {
                return;
            }

            try
            {
                ExecutableGeneratorServices executableGeneratorServices = new ExecutableGeneratorServices();
                executableGeneratorServices.GenerateExecutable(projectForm.Program, mnuMicrocontrollerLadderSaveInsideMic.Checked, mnuMicrocontrollerLadderAskPasswordToRead.Checked, confirmedPassword, true);

                File.Delete(Application.StartupPath + @"\" + projectForm.Program.Name.Replace(' ', '_') + ".a43");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Write Executable");
            }
        }