mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-29 23:58:34 +01:00
25 lines
No EOL
632 B
C#
25 lines
No EOL
632 B
C#
using System;
|
|
using System.IO;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace MLEM.Data.Content {
|
|
/// <inheritdoc />
|
|
public class XmlReader : RawContentReader {
|
|
|
|
/// <inheritdoc />
|
|
public override bool CanRead(Type t) {
|
|
return true;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override object Read(RawContentManager manager, string assetPath, Stream stream, Type t, object existing) {
|
|
return new XmlSerializer(t).Deserialize(stream);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override string[] GetFileExtensions() {
|
|
return new[] {"xml"};
|
|
}
|
|
|
|
}
|
|
} |