我开发了一个在 web 服务中获取发票数量的应用程序,它将每 2 分钟在磁贴通知中更新一次。发票编号将在 scheduleAgent.cs 的计数变量中更新。任何想法?
在主页面
ServiceReference1.WebServiceSoapClient test = new ServiceReference1.WebServiceSoapClient();
test.ReadTotalOutstandingInvoiceCompleted += new EventHandler<ServiceReference1.ReadTotalOutstandingInvoiceCompletedEventArgs>(serviceClient);
test.ReadTotalOutstandingInvoiceAsync();
private void serviceClient(object sender, ReadTotalOutstandingInvoiceCompletedEventArgs e)
{
try
{
PeriodicTask p = new PeriodicTask("jj");
p.Description = "Don't push the red button";
ScheduledActionService.Add(p);
ScheduledActionService.LaunchForTest(p.Name, TimeSpan.FromSeconds(10));
}
catch(Exception ex)
{
}
}
在 ScheduledAgent.cs
protected override void OnInvoke(ScheduledTask task)
{
//TODO: Add code to perform your task in background
ShellTile t = ShellTile.ActiveTiles.First();
StandardTileData d = new StandardTileData()
{
Title = "asdasdad",
BackTitle = "cxvxvxvxcv",
Count = 42,
BackBackgroundImage = new Uri("dog.jpg", UriKind.Relative),
BackgroundImage = new Uri("untitled.png", UriKind.Relative)
};
t.Update(d);
NotifyComplete();
}