44 lines
1.0 KiB
C#
44 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace FoxTubeDevPortal
|
|
{
|
|
public class Message
|
|
{
|
|
public string Id;
|
|
public List<string> Languages;
|
|
public Dictionary<string, string> Header;
|
|
public Dictionary<string, string> Content;
|
|
public DateTime Date;
|
|
public string Thumbnail;
|
|
public string Avatar;
|
|
|
|
|
|
public string GetSourceCode()
|
|
{
|
|
string headers = string.Empty;
|
|
foreach (var i in Header)
|
|
headers += $@" <{i.Key}>{i.Value}</{i.Key}>
|
|
";
|
|
string contents = string.Empty;
|
|
foreach (var i in Content)
|
|
contents += $@" <{i.Key}>{i.Value}</{i.Key}>
|
|
";
|
|
|
|
return $@"<post time='2/14/2019 01:30:00 AM'>
|
|
<id>{Id}</id>
|
|
<header>
|
|
{headers}</header>
|
|
<content>
|
|
{contents}</content>
|
|
<thumbnail>{Thumbnail}</thumbnail>
|
|
<avatar>{Avatar}</avatar>
|
|
</post>";
|
|
}
|
|
}
|
|
}
|