Skip to content

Commit

Permalink
OK Here we go. Now all we need is a better example
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Tampe authored and Ignacio Tampe committed Jul 19, 2020
1 parent c5b8ea3 commit 7c93b10
Show file tree
Hide file tree
Showing 51 changed files with 724 additions and 1,076 deletions.
17 changes: 17 additions & 0 deletions BasicGraphics.C/BasicGraphicFromFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.IO;

namespace Igtampe.BasicGraphics{

/// <summary>Holds a BasicGraphic from a file</summary>
public class BasicGraphicFromFile:BasicGraphic {

/// <summary>Generates a BasicGraphic item from a file</summary>
public BasicGraphicFromFile(String Filename) {
if(!File.Exists(Filename)) { throw new FileNotFoundException(); }
Name = Filename;
Contents = File.ReadAllLines(Filename);
}

}
}
16 changes: 16 additions & 0 deletions BasicGraphics.C/BasicGraphicFromResource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;

namespace Igtampe.BasicGraphics {
/// <summary>Holds a BasicGraphic from a Resource</summary>
public class BasicGraphicFromResource:BasicGraphic {

public BasicGraphicFromResource(byte[] Resource):this("Graphic From Resource",Resource) { }

/// <summary>Generates a BasicGraphic item from a file</summary>
public BasicGraphicFromResource(String Name, byte[] Resource) {
this.Name = Name;
Contents = GraphicUtils.ResourceToStringArray(Resource);
}

}
}
31 changes: 31 additions & 0 deletions BasicGraphics.C/ExampleGraphics/Cloud.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//Look ma! No dependencies!

namespace Igtampe.BasicGraphics.ExampleGraphics {
/// <summary>A Cloud graphic, used for testing.</summary>
public class Cloud:BasicGraphic {

public Cloud() {

string[] Cloud = {
"111111111111111111111111",
"111111111111111111111111",
"111111111111111111111111",
"111111111111111111111111",
"111111177771111111111111",
"111117777777711111111111",
"111177777777777777111111",
"111777777777777777771111",
"117777777777777777777711",
"111111111111111111111111",
"111111111111111111111111",
"111111111111111111111111",
"111111111111111111111111",
};

Contents = Cloud;
Name = "Cloud Graphic";
}


}
}
7 changes: 6 additions & 1 deletion BasicGraphics.C/GraphicUtils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using Igtampe.BasicGraphics.Properties;
using System;
using System.Text;

namespace Igtampe.BasicGraphics{
public static class GraphicUtils {
Expand Down Expand Up @@ -67,5 +69,8 @@ public static ConsoleColor ColorCharToConsoleColor(char ColorChar) {

}

/// <summary>Turns a resource into a string array split by lines</summary>
public static String[] ResourceToStringArray(byte[] Resource) {return Encoding.ASCII.GetString(Resource).Split('\n');}

}
}
17 changes: 17 additions & 0 deletions BasicGraphics.C/HiColorGraphicFromFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.IO;

namespace Igtampe.BasicGraphics {
/// <summary>Holds a HiColorGraphic from a file</summary>
public class HiColorGraphicFromFile:HiColorGraphic {

/// <summary>Generates a HiColorGraphic item from a file</summary>
public HiColorGraphicFromFile(String Filename) {

if(!File.Exists(Filename)) { throw new FileNotFoundException(); }
Name = Filename;
Contents = File.ReadAllLines(Filename);
}
}

}
17 changes: 17 additions & 0 deletions BasicGraphics.C/HiColorGraphicFromResource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace Igtampe.BasicGraphics {

/// <summary>Holds a HiColorGraphic from a resource</summary>
public class HiColorGraphicFromResource:HiColorGraphic {

public HiColorGraphicFromResource(byte[] Resource) : this("Graphic From Resource",Resource) { }

/// <summary>Generates a BasicGraphic item from a file</summary>
public HiColorGraphicFromResource(String Name,byte[] Resource) {
this.Name = Name;
Contents = GraphicUtils.ResourceToStringArray(Resource);
}

}
}
20 changes: 18 additions & 2 deletions BasicGraphics.C/Igtampe.BasicGraphics.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ProjectGuid>{41DBF856-B2E6-4A1C-A06A-A211186D2ACD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BasicGraphics.C</RootNamespace>
<AssemblyName>BasicGraphics.C</AssemblyName>
<RootNamespace>Igtampe.BasicGraphics</RootNamespace>
<AssemblyName>BasicGraphics</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
Expand Down Expand Up @@ -42,16 +42,32 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BasicGraphic.cs" />
<Compile Include="BasicGraphicFromFile.cs" />
<Compile Include="BasicGraphicFromResource.cs" />
<Compile Include="ExampleGraphics\Cloud.cs" />
<Compile Include="Graphic.cs" />
<Compile Include="HiColorGraphic.cs" />
<Compile Include="HiColorGraphicFromFile.cs" />
<Compile Include="HiColorGraphicFromResource.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GraphicUtils.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BasicRender\Igtampe.BasicRender.csproj">
<Project>{cd2d4436-5b3e-458c-b17a-a6822c25635f}</Project>
<Name>Igtampe.BasicRender</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
63 changes: 63 additions & 0 deletions BasicGraphics.C/Properties/Resources.Designer.cs

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

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
Expand All @@ -60,6 +60,7 @@
: 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">
Expand All @@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<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">
Expand All @@ -85,9 +87,10 @@
<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" msdata:Ordinal="1" />
<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">
Expand All @@ -109,9 +112,9 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
104 changes: 0 additions & 104 deletions BasicGraphics.VBNET/BasicGraphics.VBNET.vbproj

This file was deleted.

3 changes: 0 additions & 3 deletions BasicGraphics.VBNET/Class1.vb

This file was deleted.

Loading

0 comments on commit 7c93b10

Please sign in to comment.