Skip to content

Commit

Permalink
Fixed #5, thanks to @kumitom and @gmgru1204
Browse files Browse the repository at this point in the history
Refactored Form1 into MainScreen
  • Loading branch information
lucidlemon committed Jun 11, 2018
1 parent 1b8213b commit 1b9b0d1
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 43 deletions.
8 changes: 4 additions & 4 deletions PraiseTheSave/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
<setting name="dirDS1" serializeAs="String">
<value>ds1</value>
</setting>
<setting name="dirDSR" serializeAs="String">
<value>ds1_remastered</value>
</setting>
<setting name="dirDS2" serializeAs="String">
<value>ds3</value>
<value>ds2</value>
</setting>
<setting name="dirDS3" serializeAs="String">
<value>ds3</value>
</setting>
<setting name="dirDSR" serializeAs="String">
<value>ds1_remastered</value>
</setting>
</PraiseTheSave.Properties.Settings>
</userSettings>
</configuration>

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

20 changes: 16 additions & 4 deletions PraiseTheSave/Form1.cs → PraiseTheSave/MainScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
using System.Windows.Forms;
using System.IO;
using Ionic.Zip;
using AutoUpdaterDotNET;

namespace PraiseTheSave
{
public partial class Form1 : Form
public partial class MainScreen : Form
{
private class Game
{
Expand Down Expand Up @@ -101,7 +102,7 @@ public void Backup()

private readonly Dictionary<string, Game> games;

public Form1()
public MainScreen()
{
backupTimer = new Timer();
backupTimer.Tick += new EventHandler(DoBackup);
Expand Down Expand Up @@ -190,9 +191,20 @@ private static FileInfo GetOldestFileInDir(DirectoryInfo dir, bool checkSubdirs)
(current, next) => next.LastWriteTime < current.LastWriteTime ? next : current);
}

private void Form1_Load(object sender, EventArgs e)
private void MainScreen_Load(object sender, EventArgs e)
{

AutoUpdater.Start("https://lucidlemon.github.io/PraiseTheSave/AutoUpdater.xml");

System.Timers.Timer timer = new System.Timers.Timer
{
Interval = 2 * 60 * 1000,
SynchronizingObject = this
};
timer.Elapsed += delegate
{
AutoUpdater.Start("https://lucidlemon.github.io/PraiseTheSave/AutoUpdater.xml");
};
timer.Start();
}

public void RefreshInfo()
Expand Down
File renamed without changes.
21 changes: 13 additions & 8 deletions PraiseTheSave/PraiseTheSave.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
<ManifestTimestampUrl>http://timestamp.digicert.com</ManifestTimestampUrl>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoUpdater.NET, Version=1.4.10.0, Culture=neutral, PublicKeyToken=501435c91b35f4bc, processorArchitecture=MSIL">
<HintPath>..\packages\Autoupdater.NET.Official.1.4.10\lib\net452\AutoUpdater.NET.dll</HintPath>
</Reference>
<Reference Include="Costura, Version=2.0.1.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.2.0.1\lib\net452\Costura.dll</HintPath>
</Reference>
Expand All @@ -95,11 +98,11 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<Compile Include="MainScreen.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
<Compile Include="MainScreen.Designer.cs">
<DependentUpon>MainScreen.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand All @@ -108,8 +111,8 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resource1.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<EmbeddedResource Include="MainScreen.resx">
<DependentUpon>MainScreen.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down Expand Up @@ -138,7 +141,9 @@
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
Expand All @@ -157,15 +162,15 @@
<Content Include="sunbro_logo.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.3.0.3\build\Fody.targets" Condition="Exists('..\packages\Fody.3.0.3\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.3.0.3\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.0.3\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.2.0.1\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.2.0.1\build\Costura.Fody.targets'))" />
<Error Condition="!Exists('..\packages\Fody.3.0.4\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.0.4\build\Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.2.0.1\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.2.0.1\build\Costura.Fody.targets')" />
<Import Project="..\packages\Fody.3.0.4\build\Fody.targets" Condition="Exists('..\packages\Fody.3.0.4\build\Fody.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
2 changes: 1 addition & 1 deletion PraiseTheSave/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new MainScreen());
}
}
}
44 changes: 27 additions & 17 deletions PraiseTheSave/Properties/Settings.Designer.cs

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

6 changes: 3 additions & 3 deletions PraiseTheSave/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<Setting Name="dirDS1" Type="System.String" Scope="User">
<Value Profile="(Default)">ds1</Value>
</Setting>
<Setting Name="dirDS2" Type="System.String" Scope="User">
<Value Profile="(Default)">ds3</Value>
</Setting>
<Setting Name="dirDS3" Type="System.String" Scope="User">
<Value Profile="(Default)">ds3</Value>
</Setting>
<Setting Name="dirDSR" Type="System.String" Scope="User">
<Value Profile="(Default)">ds1_remastered</Value>
</Setting>
<Setting Name="dirDS2" Type="System.String" Scope="User">
<Value Profile="(Default)">ds2</Value>
</Setting>
</Settings>
</SettingsFile>
3 changes: 2 additions & 1 deletion PraiseTheSave/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autoupdater.NET.Official" version="1.4.10" targetFramework="net452" />
<package id="Costura.Fody" version="2.0.1" targetFramework="net452" developmentDependency="true" />
<package id="DotNetZip" version="1.11.0" targetFramework="net452" />
<package id="Fody" version="3.0.3" targetFramework="net452" developmentDependency="true" />
<package id="Fody" version="3.0.4" targetFramework="net452" developmentDependency="true" />
</packages>

0 comments on commit 1b9b0d1

Please # to comment.