我开发了一个应用程序,它可以获取webservice中的发票数量,并且每隔2分钟就会在磁贴通知中更新。发票号将在scheduledAgent.cs的count变量中更新。有什么想法吗?
在主页
中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();
}