我在寻找一种方式来存储使用我的本地文件系统的图像文件PCL存储插件在我的核心项目Windows Phone,Xamarin.Android以及Xamarin.iOS.但是,插件只提供了编写Text的方法.什么关于字节.有没有办法保存字节数组?
我正在尝试将以下xml反序列化为对象。Xml有多个名称空间。我试图将Xml反序列化为一个对象。对象(数据)具有对LastChannel对象的引用。但是当我要求应该给我LastChannel的data.channel时,我得到了一个nullpointer。
Xml:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:mp="http://www.tagesschau.de/rss/1.0/modules/metaplus/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>title</title>
<description>Default description</description>
<dc:date>2013-04-15 13:27:06</dc:date>
<sy:updateBase>2013-04-15 13:27:06</sy:updateBase>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>12</sy:updateFrequency>
</channel>
</rdf:RDF>
Run Code Online (Sandbox Code Playgroud)
对象看起来像这样:
[XmlRoot("RDF", Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")]
public class LastRss
{
[XmlElement("channel")]
public LastChannel channel { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
和
public class LastChannel
{
[XmlElement("title")]
public string title { get; set; }
[XmlElement("description")]
public string description { get; set; }
[XmlElement("date", Namespace = "http://purl.org/dc/elements/1.1/")]
public DateTime date { get; set; }
[XmlElement("updateBase", Namespace = "http://purl.org/rss/1.0/modules/syndication/")]
public DateTime updateBase { get; …Run Code Online (Sandbox Code Playgroud)