private void WriteAttribute(NodeAttribute attr)
{
switch (attr.Type)
{
case NodeAttribute.DataType.DT_String:
case NodeAttribute.DataType.DT_Path:
case NodeAttribute.DataType.DT_FixedString:
case NodeAttribute.DataType.DT_LSString:
WriteString((string)attr.Value, true);
break;
case NodeAttribute.DataType.DT_WString:
case NodeAttribute.DataType.DT_LSWString:
WriteWideString((string)attr.Value, true);
break;
case NodeAttribute.DataType.DT_TranslatedString:
var str = (TranslatedString)attr.Value;
WriteString(str.Value, true);
WriteString(str.Handle, true);
break;
case NodeAttribute.DataType.DT_ScratchBuffer:
var buffer = (byte[])attr.Value;
writer.Write((UInt32)buffer.Length);
writer.Write(buffer);
break;
default:
BinUtils.WriteAttribute(writer, attr);
break;
}
}