Skip to content

Commit

Permalink
fix for autobackup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremysimmons committed Feb 19, 2018
1 parent 108360a commit e0e0726
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

[assembly: AssemblyTitle("heightmap2stl-gui")]
[assembly: AssemblyProduct("heightmap2stl-gui")]
[assembly: AssemblyVersion("1.3.3.0")]
[assembly: AssemblyFileVersion("1.3.3.0")]
[assembly: AssemblyVersion("1.3.4.0")]
[assembly: AssemblyFileVersion("1.3.4.0")]

namespace app
{
Expand Down Expand Up @@ -58,9 +58,11 @@ protected override void OnLoad(EventArgs e)
Log($"Version: {GetVersion()}");

// Autobackup
Boolean.TryParse(ConfigurationManager.AppSettings["AutoBackup"], out _autoBackup);
chkAutoBackup.Checked = _autoBackup;
Log($"AutoBackup: {_autoBackup}");
if (Boolean.TryParse(ConfigurationManager.AppSettings["AutoBackup"], out _autoBackup))
{
chkAutoBackup.Checked = _autoBackup;
Log($"AutoBackup: {_autoBackup}");
}
}

private Version GetVersion() => Assembly.GetEntryAssembly().GetName().Version;
Expand Down Expand Up @@ -95,9 +97,9 @@ private void btnCreate_Click(object sender, EventArgs e)
var stlFile = new FileInfo(Path.Combine(outDirectory,
Path.GetFileNameWithoutExtension(rawFileName.FullName) + ".stl"));

Log($"Autobackup: {_autoBackup}");
if (_autoBackup)
{
Log($"Autobackup: {_autoBackup}");
var backupStlFile = new FileInfo(Path.Combine(
// Directory
outDirectory,
Expand Down Expand Up @@ -445,6 +447,11 @@ private void UpdateOutputPath()
{
txtOutputPath.Text = GetOutputPath();
}

private void chkAutoBackup_Click(object sender, EventArgs e)
{
_autoBackup = chkAutoBackup.Checked;
}
}
}
namespace app
Expand Down

0 comments on commit e0e0726

Please sign in to comment.