0.513.0.5130420 + UniqueId
Caught up with latest API changes and implemented UniqueId.
This commit is contained in:
29
Tokens/UniqueId.cs
Normal file
29
Tokens/UniqueId.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
|
||||
namespace RobloxFiles.Tokens
|
||||
{
|
||||
public class UniqueId : IXmlPropertyToken
|
||||
{
|
||||
public string XmlPropertyToken => "UniqueId";
|
||||
|
||||
public bool ReadProperty(Property prop, XmlNode token)
|
||||
{
|
||||
string hex = token.InnerText;
|
||||
|
||||
if (Guid.TryParse(hex, out var guid))
|
||||
{
|
||||
prop.Value = guid;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void WriteProperty(Property prop, XmlDocument doc, XmlNode node)
|
||||
{
|
||||
var guid = prop.CastValue<Guid>();
|
||||
node.InnerText = guid.ToString("N");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user