34642f5656
Support for binary files will be coming later.
32 lines
771 B
C#
32 lines
771 B
C#
using System.Xml;
|
|
|
|
namespace RobloxFiles.XmlFormat.PropertyTokens
|
|
{
|
|
public class RefToken : IXmlPropertyToken
|
|
{
|
|
public string Token => "Ref";
|
|
|
|
public bool ReadProperty(Property prop, XmlNode token)
|
|
{
|
|
string refId = token.InnerText;
|
|
prop.Type = PropertyType.Ref;
|
|
prop.Value = refId;
|
|
|
|
return true;
|
|
}
|
|
|
|
public void WriteProperty(Property prop, XmlDocument doc, XmlNode node)
|
|
{
|
|
string result = "null";
|
|
|
|
if (prop.Value != null && prop.Value.ToString() != "null")
|
|
{
|
|
Instance inst = prop.Value as Instance;
|
|
result = inst.XmlReferent;
|
|
}
|
|
|
|
node.InnerText = result;
|
|
}
|
|
}
|
|
}
|