Beispiel #1
0
 private static void _syncWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     SyncClient syncProxy = new SyncClient();
     List<Identity> updates = syncProxy.GetIdentities(new Request() { LastRequest = _lastUpdated });
     lock (locker)
     {
         foreach (Identity upd in updates)
         {
             Identity id = Identities.FirstOrDefault<Identity>(delegate(Identity Iden) { return Iden.Id == upd.Id; });
             if (id == null)
             {
                 Identities.Add(upd);
             }
             else
             {
                 id.FirstName = upd.FirstName;
                 id.LastName = upd.LastName;
                 id.LastUpdated = upd.LastUpdated;
             }
         }
         _lastUpdated = DateTime.Now;
     }
 }