Skip to content
This repository has been archived by the owner on Aug 22, 2018. It is now read-only.

Commit

Permalink
Notify when config needs to be reset and update Costura+/Fody
Browse files Browse the repository at this point in the history
  • Loading branch information
judge2020 committed Apr 10, 2017
1 parent 1c3937c commit 2c9706d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,16 @@
<Content Include="packages\HearthstoneDeckTracker.exe" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.1.28.3\build\Fody.targets" Condition="Exists('..\packages\Fody.1.28.3\build\Fody.targets')" />
<PropertyGroup>
<PostBuildEvent>if "$(ConfigurationName)" == "PluginsFolder" copy /Y "$(TargetPath)" "%25appdata%25\HearthstoneDeckTracker\Plugins\$(TargetName).dll"</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\Fody.1.29.4\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.4\build\dotnet\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.1.28.3\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.28.3\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.4\build\dotnet\Fody.targets'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>if "$(ConfigurationName)" == "PluginsFolder" copy /Y "$(TargetPath)" "%25appdata%25\HearthstoneDeckTracker\Plugins\$(TargetName).dll"</PostBuildEvent>
</PropertyGroup>
<!-- 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
64 changes: 42 additions & 22 deletions Hearthstone Collection Tracker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -31,28 +32,47 @@ public Thickness TitleBarMargin

public MainWindow()
{
SetsInfo = HearthstoneCollectionTrackerPlugin.Settings.ActiveAccountSetsInfo.Select(set => new SetDetailInfoViewModel
{
SetName = set.SetName,
SetCards = new TrulyObservableCollection<CardInCollection>(set.Cards.ToList())
});

this.MaxHeight = SystemParameters.PrimaryScreenHeight;
InitializeComponent();

Filter = new FilterSettings();
Filter.PropertyChanged += (sender, args) =>
{
HandleFilterChange(sender, args);
};

string activeAccount = HearthstoneCollectionTrackerPlugin.Settings.ActiveAccount;
Title = "Collection Tracker";
if (!string.IsNullOrEmpty(activeAccount))
{
Title += " (" + activeAccount + ")";
}
}
try
{
SetsInfo = HearthstoneCollectionTrackerPlugin.Settings.ActiveAccountSetsInfo.Select(set => new SetDetailInfoViewModel
{
SetName = set.SetName,
SetCards = new TrulyObservableCollection<CardInCollection>(set.Cards.ToList())
});

this.MaxHeight = SystemParameters.PrimaryScreenHeight;
InitializeComponent();

Filter = new FilterSettings();
Filter.PropertyChanged += (sender, args) =>
{
HandleFilterChange(sender, args);
};

string activeAccount = HearthstoneCollectionTrackerPlugin.Settings.ActiveAccount;
Title = "Collection Tracker";
if(!string.IsNullOrEmpty(activeAccount))
{
Title += " (" + activeAccount + ")";
}
}
catch(Exception e)
{
var f = MessageBox.Show("Your Collection config file seems to be corrupted or out of date. \nReset it now?\n sorry for any inconvenience.", "Hearthstone Collection Tracker", MessageBoxButton.YesNo);
if(f == MessageBoxResult.Yes)
{
foreach(
var file in
Directory.GetFiles(HearthstoneCollectionTrackerPlugin.PluginDataDir, "Collection_*.xml",
SearchOption.TopDirectoryOnly))
{
File.Delete(file);

}
Core.MainWindow.Restart();
}
}
}

private void EditCollection(SetDetailInfoViewModel setInfo)
{
Expand Down
4 changes: 2 additions & 2 deletions Hearthstone Collection Tracker/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="1.3.2.0" targetFramework="net45" developmentDependency="true" />
<package id="Fody" version="1.28.3" targetFramework="net45" developmentDependency="true" />
<package id="Costura.Fody" version="1.3.3.0" targetFramework="net45" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net45" developmentDependency="true" />
<package id="MahApps.Metro" version="1.1.2.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
</packages>

0 comments on commit 2c9706d

Please sign in to comment.