move xmlgame to client.common and refactor it a bit in order to achieve that
This commit is contained in:
parent
0edfc03e34
commit
40f143e4ad
|
@ -33,6 +33,9 @@
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="ICSharpCode.SharpZipLib">
|
||||||
|
<HintPath>..\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json">
|
<Reference Include="Newtonsoft.Json">
|
||||||
<HintPath>..\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
@ -112,6 +115,7 @@
|
||||||
<Compile Include="tools\RamSearchEngine.cs" />
|
<Compile Include="tools\RamSearchEngine.cs" />
|
||||||
<Compile Include="tools\Watch.cs" />
|
<Compile Include="tools\Watch.cs" />
|
||||||
<Compile Include="tools\WatchList.cs" />
|
<Compile Include="tools\WatchList.cs" />
|
||||||
|
<Compile Include="XmlGame.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BizHawk.Common\BizHawk.Common.csproj">
|
<ProjectReference Include="..\BizHawk.Common\BizHawk.Common.csproj">
|
||||||
|
|
|
@ -5,9 +5,7 @@ using System.Text;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
namespace BizHawk.Client.Common
|
||||||
|
|
||||||
namespace BizHawk.MultiClient
|
|
||||||
{
|
{
|
||||||
public class XmlGame
|
public class XmlGame
|
||||||
{
|
{
|
||||||
|
@ -96,10 +94,9 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show(e.ToString(), "XMLGame Load Error");
|
throw new InvalidOperationException(ex.ToString());
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -737,7 +737,6 @@
|
||||||
<Compile Include="tools\Watch\WatchValueBox.cs">
|
<Compile Include="tools\Watch\WatchValueBox.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="XmlGame.cs" />
|
|
||||||
<EmbeddedResource Include="AVOut\FFmpegWriterForm.resx">
|
<EmbeddedResource Include="AVOut\FFmpegWriterForm.resx">
|
||||||
<DependentUpon>FFmpegWriterForm.cs</DependentUpon>
|
<DependentUpon>FFmpegWriterForm.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
|
@ -1228,10 +1228,9 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
else if (file.Extension.ToLower() == ".xml")
|
else if (file.Extension.ToLower() == ".xml")
|
||||||
{
|
{
|
||||||
var XMLG = XmlGame.Create(file);
|
try
|
||||||
|
|
||||||
if (XMLG != null)
|
|
||||||
{
|
{
|
||||||
|
var XMLG = XmlGame.Create(file); // if load fails, are we supposed to retry as a bsnes XML????????
|
||||||
game = XMLG.GI;
|
game = XMLG.GI;
|
||||||
|
|
||||||
switch (game.System)
|
switch (game.System)
|
||||||
|
@ -1256,9 +1255,11 @@ namespace BizHawk.MultiClient
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// if load fails, are we supposed to retry as a bsnes XML????????
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
System.Windows.Forms.MessageBox.Show(ex.ToString(), "XMLGame Load Error");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // most extensions
|
else // most extensions
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue