Пример #1
0
        private void B_SaveAndClose_Click(object sender, EventArgs e)
        {
            UpdateSettings();
            _settingManager.Update(_settings);

            B_Close.PerformClick();
        }
        /// <summary>
        /// This will create the create the checksums and start coping the files
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void B_Create_Click(object sender, EventArgs e)
        {
            string inputFolder  = TB_InputFolder.Text;
            string outputFolder = TB_OutputFolder.Text;

            DirectoryInfo inputFolderInfo = new DirectoryInfo(inputFolder);

            if (!inputFolderInfo.Exists)
            {
                MessageBox.Show($"The given input folder {inputFolder} is not existing", "Input folder not existing", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            CreateDownloadableManager createDownloadable = new CreateDownloadableManager(inputFolder, outputFolder);

            if (!createDownloadable.CreateServerData())
            {
                MessageBox.Show($"The was an error while processing the input folder!", "Error while creating server data", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            CreateProjectConfig projectConfig = null;

            if (DialogResult.Yes == MessageBox.Show("Do you want to create the project config as well?", "Create project config", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
            {
                projectConfig = new CreateProjectConfig(inputFolder)
                {
                    StartPosition = FormStartPosition.CenterParent
                };

                projectConfig.ShowDialog();
            }

            ProjectConfigJson dataJSON = null;

            if (projectConfig != null)
            {
                dataJSON = projectConfig.ProjectConfigJson;
            }

            createDownloadable.SaveServerData(dataJSON);

            B_Close.PerformClick();
        }