【发布时间】:2015-08-29 01:44:17
【问题描述】:
我在 Windows 商店中使用 Azure 存储类库。 有一个 DynamicTableEntity 类,但我想像我们在 WPF 中所做的那样继承 TableEntity 类。
那么如何在windows store APP中创建TableEntity类,谁能分享一下代码? 现在我只使用这样的代码:
public class PictureEntity
{
private DynamicTableEntity entity;
public PictureEntity()
{
//TODO:This username should be changed to User account in real app
this.entity = new DynamicTableEntity() { PartitionKey = "UserName", RowKey = DateTime.Now.ToFileTime().ToString() };
}
public string Name {
get
{
return entity.Properties["FileName"].StringValue;
}
set
{
entity.Properties.Add(new KeyValuePair<string, EntityProperty>("FileName", new EntityProperty(value)));
}
}
public string PictureUrl {
get
{
return entity.Properties["ImageUrl"].StringValue;
}
set
{
entity.Properties.Add(new KeyValuePair<string, EntityProperty>("ImageUrl", new EntityProperty(value)));
}
}
public string Description
{
get
{
return entity.Properties["Description"].StringValue;
}
set
{
entity.Properties.Add(new KeyValuePair<string, EntityProperty>("Description", new EntityProperty(value)));
}
}
public DynamicTableEntity PictureTableEntity { get { return entity; } set {
entity = value;
} }
public StorageFile PictureFile { get; set; }
}
【问题讨论】:
标签: azure windows-store