Esempio n. 1
0
 public async void RevisionPooling()
 {
     await Task.Run(() =>
     {
         while (true)
         {
             if (FileRevisions.Count > 0)
             {
                 Revision r = g.GetLatestRevision(fileID);
                 if (r != null && r.ModifiedTime > LastModifiedTime)
                 {
                     r.Kind = "notify";
                     this.lstRevisions.Dispatcher.Invoke(new UpdateRevisionListCallback(this.UpdateRevisionList), r);
                 }
             }
             System.Threading.Thread.Sleep(delay);
         }
     });
 }
        public static async void RevisionPooling()
        {
            await Task.Run(() =>
            {
                while (true)
                {
                    Revision r = g.GetLatestRevision(fileID);
                    if (r != null && int.Parse(r.Id) > LatestRevID)
                    {
                        LatestRevID = int.Parse(r.Id);
                        Revisions.Insert(0, r);
                        Console.Clear();

                        foreach (Revision item in Revisions)
                        {
                            Console.WriteLine(item.ModifiedTime + " - " + item.LastModifyingUser.DisplayName);
                        }
                    }
                    System.Threading.Thread.Sleep(2000);
                }
            });
        }