Added write support for binary files!

Holy cow, this took a lot of work. I think I may need to do a few more
things before I consider this a 1.0 release, but I'm glad to have
finally overcome this hurdle!
This commit is contained in:
CloneTrooper1019
2019-06-07 22:43:28 -05:00
parent cb063d1ada
commit 47112242e7
22 changed files with 1405 additions and 222 deletions

View File

@ -1,12 +0,0 @@
using System.Xml;
namespace RobloxFiles.XmlFormat
{
public interface IXmlPropertyToken
{
string Token { get; }
bool ReadProperty(Property prop, XmlNode token);
void WriteProperty(Property prop, XmlDocument doc, XmlNode node);
}
}

View File

@ -22,7 +22,7 @@ namespace RobloxFiles.XmlFormat.PropertyTokens
if (prop.Value != null && prop.Value.ToString() != "null")
{
Instance inst = prop.Value as Instance;
result = inst.XmlReferent;
result = inst.Referent;
}
node.InnerText = result;

View File

@ -40,12 +40,13 @@ namespace RobloxFiles.XmlFormat
try
{
string value = token.InnerText;
Type type = typeof(T);
if (typeof(T) == typeof(int))
if (type == typeof(int))
prop.Value = Formatting.ParseInt(value);
else if (typeof(T) == typeof(float))
else if (type == typeof(float))
prop.Value = Formatting.ParseFloat(value);
else if (typeof(T) == typeof(double))
else if (type == typeof(double))
prop.Value = Formatting.ParseDouble(value);
if (prop.Value == null)