Skip to content

Commit

Permalink
window-size and -position are saved.
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Mar 22, 2016
1 parent b92be6d commit a00583d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
<setting name="consideredStats" serializeAs="String">
<value>51</value>
</setting>
<setting name="formSize" serializeAs="String">
<value>791, 627</value>
</setting>
<setting name="formLocation" serializeAs="String">
<value>100, 100</value>
</setting>
</ARKBreedingStats.Properties.Settings>
</userSettings>
</configuration>
8 changes: 8 additions & 0 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public Form1()

private void Form1_Load(object sender, EventArgs e)
{
// load window-position and size
this.Size = Properties.Settings.Default.formSize;
this.Location = Properties.Settings.Default.formLocation;

statIOs.Add(this.statIOHealth);
statIOs.Add(this.statIOStamina);
statIOs.Add(this.statIOOxygen);
Expand Down Expand Up @@ -1535,6 +1539,10 @@ private void Form1_FormClosed(object sender, FormClosedEventArgs e)
}
Properties.Settings.Default.consideredStats = consideredStats;

// save window-position and size
Properties.Settings.Default.formSize = this.Size;
Properties.Settings.Default.formLocation = this.Location;

// save settings for next session
Properties.Settings.Default.Save();
}
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.17.7.0")]
[assembly: AssemblyFileVersion("0.17.8.0")]
24 changes: 24 additions & 0 deletions ARKBreedingStats/Properties/Settings.Designer.cs

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

6 changes: 6 additions & 0 deletions ARKBreedingStats/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@
<Setting Name="consideredStats" Type="System.Int32" Scope="User">
<Value Profile="(Default)">51</Value>
</Setting>
<Setting Name="formSize" Type="System.Drawing.Size" Scope="User">
<Value Profile="(Default)">791, 627</Value>
</Setting>
<Setting Name="formLocation" Type="System.Drawing.Point" Scope="User">
<Value Profile="(Default)">100, 100</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit a00583d

Please sign in to comment.