protected override void OnInvoke(ScheduledTask task) { if (DeviceNetworkInformation.IsNetworkAvailable) { VelesConflictReporting.ReportingServiceClient client = new VelesConflictReporting.ReportingServiceClient(); client.GetLatestNewsCompleted += new EventHandler<VelesConflictReporting.GetLatestNewsCompletedEventArgs>(client_GetLatestNewsCompleted); client.GetLatestNewsAsync(Locale); } else { NotifyComplete(); } }
void TryPushStatistics() { if (playerData.ReportingEnabled) { if (DeviceNetworkInformation.IsNetworkAvailable) { VelesConflictReporting.ReportingServiceClient rsc = new VelesConflictReporting.ReportingServiceClient(); rsc.RegisterDeviceCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(rsc_RegisterDeviceCompleted); if (!playerData.DeviceRegistered) { rsc.RegisterDeviceAsync(DeviceID, rsc); } else { if (GameUsage.Count > 0) { lock (GameUsage) { UpdatingGameUsage = true; rsc.AddBatchGameUsageStasticsCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(rsc_AddBatchGameUsageStasticsCompleted); rsc.AddBatchGameUsageStasticsAsync(GameUsage.ToArray(), GameUsage.ToArray()); } } if (MenuUsage.Count > 0) { lock (MenuUsage) { rsc.AddBatchMenuUsageStasticsCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(rsc_AddBatchMenuUsageStasticsCompleted); rsc.AddBatchMenuUsageStasticsAsync(MenuUsage.ToArray(), MenuUsage.ToArray()); } } rsc.CloseAsync(); } } } }