2019-06-30 22:01:19 +00:00
|
|
|
|
using System.Xml;
|
|
|
|
|
using RobloxFiles.DataTypes;
|
2019-05-17 06:14:04 +00:00
|
|
|
|
|
|
|
|
|
namespace RobloxFiles.XmlFormat.PropertyTokens
|
|
|
|
|
{
|
|
|
|
|
public class SharedStringToken : IXmlPropertyToken
|
|
|
|
|
{
|
|
|
|
|
public string Token => "SharedString";
|
|
|
|
|
|
2019-05-17 12:08:06 +00:00
|
|
|
|
public bool ReadProperty(Property prop, XmlNode token)
|
2019-05-17 06:14:04 +00:00
|
|
|
|
{
|
2019-06-30 22:01:19 +00:00
|
|
|
|
string md5 = token.InnerText;
|
2019-05-17 06:14:04 +00:00
|
|
|
|
prop.Type = PropertyType.SharedString;
|
2019-06-30 22:01:19 +00:00
|
|
|
|
prop.Value = new SharedString(md5);
|
2019-05-17 06:14:04 +00:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2019-05-17 12:08:06 +00:00
|
|
|
|
|
|
|
|
|
public void WriteProperty(Property prop, XmlDocument doc, XmlNode node)
|
|
|
|
|
{
|
2019-06-30 22:01:19 +00:00
|
|
|
|
SharedString value = prop.CastValue<SharedString>();
|
|
|
|
|
node.InnerText = value.MD5_Key;
|
2019-05-17 12:08:06 +00:00
|
|
|
|
}
|
2019-05-17 06:14:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|