2019-01-30 06:36:56 +00:00
|
|
|
|
using System.Xml;
|
|
|
|
|
|
2021-02-25 20:09:54 +00:00
|
|
|
|
namespace RobloxFiles.Tokens
|
2019-01-30 06:36:56 +00:00
|
|
|
|
{
|
|
|
|
|
public class RefToken : IXmlPropertyToken
|
|
|
|
|
{
|
2021-02-25 20:09:54 +00:00
|
|
|
|
public string XmlPropertyToken => "Ref";
|
2019-01-30 06:36:56 +00:00
|
|
|
|
|
2019-05-17 12:08:06 +00:00
|
|
|
|
public bool ReadProperty(Property prop, XmlNode token)
|
2019-01-30 06:36:56 +00:00
|
|
|
|
{
|
|
|
|
|
string refId = token.InnerText;
|
|
|
|
|
prop.Type = PropertyType.Ref;
|
2019-06-30 22:01:19 +00:00
|
|
|
|
prop.XmlToken = refId;
|
2019-01-30 06:36:56 +00:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2019-05-17 12:08:06 +00:00
|
|
|
|
|
|
|
|
|
public void WriteProperty(Property prop, XmlDocument doc, XmlNode node)
|
|
|
|
|
{
|
|
|
|
|
string result = "null";
|
|
|
|
|
|
2019-06-30 22:01:19 +00:00
|
|
|
|
if (prop.Value != null)
|
2019-05-17 12:08:06 +00:00
|
|
|
|
{
|
2019-06-30 22:01:19 +00:00
|
|
|
|
Instance inst = prop.CastValue<Instance>();
|
2019-06-08 03:43:28 +00:00
|
|
|
|
result = inst.Referent;
|
2019-05-17 12:08:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
node.InnerText = result;
|
|
|
|
|
}
|
2019-01-30 06:36:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|