32 lines
673 B
C#
32 lines
673 B
C#
using ImGuiNET;
|
|
|
|
namespace Shoko;
|
|
|
|
[MediaType("text/plain")]
|
|
[MediaType("text/*")]
|
|
class PlainMediaHandler : MediaHandler
|
|
{
|
|
List<string> lines;
|
|
public PlainMediaHandler(ProtoHandler content)
|
|
{
|
|
Content = content;
|
|
lines = new List<string>();
|
|
}
|
|
|
|
public override void Load()
|
|
{
|
|
Title = new UriBuilder(Content.URL).Path;
|
|
var reader = new StreamReader(Content.Content);
|
|
string line;
|
|
while((line = reader.ReadLine()) is not null)
|
|
{
|
|
lines.Add(line);
|
|
}
|
|
}
|
|
|
|
public override void Render()
|
|
{
|
|
foreach(var line in lines)
|
|
ImGui.TextUnformatted(line);
|
|
}
|
|
} |