replaced resx with simpler static file lookup

This commit is contained in:
Rudis Muiznieks 2016-09-20 12:19:11 -05:00
parent dc162cc2a6
commit 6f04123f3f
No known key found for this signature in database
GPG Key ID: 1C290B51E05090F8
4 changed files with 132 additions and 381 deletions

View File

@ -1,113 +1,109 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{780F652D-7541-4171-BB89-2D263D3961DC}</ProjectGuid> <ProjectGuid>{780F652D-7541-4171-BB89-2D263D3961DC}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Ficdown.Parser</RootNamespace> <RootNamespace>Ficdown.Parser</RootNamespace>
<AssemblyName>Ficdown.Parser</AssemblyName> <AssemblyName>Ficdown.Parser</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Epub4Net"> <Reference Include="Epub4Net">
<HintPath>..\packages\Epub4Net.1.2.0\lib\net40\Epub4Net.dll</HintPath> <HintPath>..\packages\Epub4Net.1.2.0\lib\net40\Epub4Net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ionic.Zip"> <Reference Include="Ionic.Zip">
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath> <HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
</Reference> </Reference>
<Reference Include="MarkdownSharp"> <Reference Include="MarkdownSharp">
<HintPath>..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll</HintPath> <HintPath>..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Model\Parser\ResolvedPage.cs" /> <Compile Include="Model\Parser\ResolvedPage.cs" />
<Compile Include="Model\Parser\ResolvedStory.cs" /> <Compile Include="Model\Parser\ResolvedStory.cs" />
<Compile Include="Model\Player\PageState.cs" /> <Compile Include="Model\Player\PageState.cs" />
<Compile Include="Model\Player\State.cs" /> <Compile Include="Model\Player\State.cs" />
<Compile Include="Model\Player\StateQueueItem.cs" /> <Compile Include="Model\Player\StateQueueItem.cs" />
<Compile Include="Parser\BlockHandler.cs" /> <Compile Include="Parser\BlockHandler.cs" />
<Compile Include="Parser\IBlockHandler.cs" /> <Compile Include="Parser\IBlockHandler.cs" />
<Compile Include="Parser\RegexLib.cs" /> <Compile Include="Parser\RegexLib.cs" />
<Compile Include="Parser\StateResolver.cs" /> <Compile Include="Parser\StateResolver.cs" />
<Compile Include="Parser\Utilities.cs" /> <Compile Include="Parser\Utilities.cs" />
<Compile Include="FicDownParser.cs" /> <Compile Include="FicDownParser.cs" />
<Compile Include="Model\Parser\Anchor.cs" /> <Compile Include="Model\Parser\Anchor.cs" />
<Compile Include="Model\Parser\Block.cs" /> <Compile Include="Model\Parser\Block.cs" />
<Compile Include="Model\Parser\BlockType.cs" /> <Compile Include="Model\Parser\BlockType.cs" />
<Compile Include="Parser\IStateResolver.cs" /> <Compile Include="Parser\IStateResolver.cs" />
<Compile Include="Model\Parser\Href.cs" /> <Compile Include="Model\Parser\Href.cs" />
<Compile Include="Model\Player\PlayerState.cs" /> <Compile Include="Model\Player\PlayerState.cs" />
<Compile Include="Model\Story\Extensions\SceneExtensions.cs" /> <Compile Include="Model\Story\Extensions\SceneExtensions.cs" />
<Compile Include="Player\GameTraverser.cs" /> <Compile Include="Player\GameTraverser.cs" />
<Compile Include="Player\IGameTraverser.cs" /> <Compile Include="Player\IGameTraverser.cs" />
<Compile Include="Player\StateManager.cs" /> <Compile Include="Player\StateManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Model\Story\Action.cs" /> <Compile Include="Model\Story\Action.cs" />
<Compile Include="Model\Story\Scene.cs" /> <Compile Include="Model\Story\Scene.cs" />
<Compile Include="Model\Story\Story.cs" /> <Compile Include="Model\Story\Story.cs" />
<Compile Include="Render\EpubRenderer.cs" /> <Compile Include="Render\EpubRenderer.cs" />
<Compile Include="Render\HtmlRenderer.cs" /> <Compile Include="Render\HtmlRenderer.cs" />
<Compile Include="Render\IRenderer.cs" /> <Compile Include="Render\IRenderer.cs" />
<Compile Include="Render\MimeHelper.cs" /> <Compile Include="Render\MimeHelper.cs" />
<Compile Include="Render\Template.Designer.cs"> <Compile Include="Model\Parser\Line.cs" />
<AutoGen>True</AutoGen> <Compile Include="Model\Parser\FicdownException.cs" />
<DesignTime>True</DesignTime> <Compile Include="Parser\ParserExtensions.cs" />
<DependentUpon>Template.resx</DependentUpon> <Compile Include="Model\Parser\Orphan.cs" />
</Compile> <Compile Include="Render\Template.cs" />
<Compile Include="Model\Parser\Line.cs" /> </ItemGroup>
<Compile Include="Model\Parser\FicdownException.cs" /> <ItemGroup>
<Compile Include="Parser\ParserExtensions.cs" /> <None Include="packages.config" />
<Compile Include="Model\Parser\Orphan.cs" /> <Content Include="Render\Views\scene.html">
</ItemGroup> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<ItemGroup> </Content>
<None Include="packages.config" /> </ItemGroup>
<Content Include="Render\Views\scene.html" /> <ItemGroup>
</ItemGroup> <Content Include="Render\Assets\styles.css">
<ItemGroup> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Content Include="Render\Assets\styles.css" /> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Render\Views\index.html" /> <Content Include="Render\Views\index.html">
</ItemGroup> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<ItemGroup> </Content>
<EmbeddedResource Include="Render\Template.resx"> </ItemGroup>
<Generator>ResXFileCodeGenerator</Generator> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<LastGenOutput>Template.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- 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. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@ -1,144 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Ficdown.Parser.Render {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Template {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Template() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ficdown.Parser.Render.Template", typeof(Template).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to &lt;!DOCTYPE html&gt;
///
///&lt;html lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
///&lt;head&gt;
/// &lt;meta charset=&quot;utf-8&quot; /&gt;
/// &lt;title&gt;@Title&lt;/title&gt;
/// &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;styles.css&quot;/&gt;
///&lt;/head&gt;
/// &lt;body&gt;
/// &lt;h1 class=&quot;title&quot;&gt;@Title&lt;/h1&gt;
/// @Description
/// &lt;p&gt;&lt;a href=&quot;@FirstScene&quot;&gt;Begin reading...&lt;/a&gt;&lt;/p&gt;
/// &lt;/body&gt;
///&lt;/html&gt;.
/// </summary>
internal static string Index {
get {
return ResourceManager.GetString("Index", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;!DOCTYPE html&gt;
///
///&lt;html lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
///&lt;head&gt;
/// &lt;meta charset=&quot;utf-8&quot; /&gt;
/// &lt;title&gt;@Title&lt;/title&gt;
/// &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;styles.css&quot; /&gt;
///&lt;/head&gt;
///&lt;body&gt;
/// @Content
///&lt;/body&gt;
///&lt;/html&gt;.
/// </summary>
internal static string Scene {
get {
return ResourceManager.GetString("Scene", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to /* Adapted from http://wiki.mobileread.com/wiki/CSS_template */
///
///@page {
/// margin-top: 30px;
/// margin-bottom: 20px;
///}
///
///body {
/// margin-right: 30px;
/// margin-left: 30px;
/// padding: 0;
///}
///
///img {
/// max-width: 100%;
/// oeb-column-number: 1;
/// display: inline-block;
///}
///
///a {
/// font-style: italic;
/// color: #000;
/// text-decoration: none;
///}
///
///h1.title {
/// font-family: Verdana, Geneva, sans-serif;
/// font-size: x-large;
/// text-align: center;
/// font-weight: bold;
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string Styles {
get {
return ResourceManager.GetString("Styles", resourceCulture);
}
}
}
}

View File

@ -0,0 +1,29 @@
namespace Ficdown.Parser.Render
{
using System;
using System.IO;
public static class Template
{
public static string Index
{
get { return GetFileContents("Views/index.html"); }
}
public static string Scene
{
get { return GetFileContents("Views/scene.html"); }
}
public static string Styles
{
get { return GetFileContents("Assets/styles.css"); }
}
private static string GetFileContents(string fname)
{
var path = Path.Combine(Environment.CurrentDirectory, string.Format("Render/{0}", fname));
return File.ReadAllText(path);
}
}
}

View File

@ -1,130 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Index" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Views\index.html;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Scene" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Views\scene.html;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Styles" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Assets\styles.css;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>