示例#1
0
 static void DeleteComment(AtomEntry commentEntry)
 {
     Console.WriteLine("\nDeleting the comment");
     if (commentEntry != null)
     {
         // Delete the comment.
         Console.WriteLine("  Press enter to delete the new comment post");
         Console.ReadLine();
         commentEntry.Delete();
     }
 }
示例#2
0
文件: GGSync.cs 项目: wertkh32/gg
 /// <summary>
 /// Solve conflict by comparing last modified time
 /// </summary>
 /// <param name="addToLocal">List of GGItems to be added to local GGList</param>
 /// <param name="removeFromLocal">List of GGItems to be removed from local GGList</param>
 /// <param name="GGService">Google calendar service object</param>
 /// <param name="GGCalendar">GG calendar</param>
 /// <param name="ggItem">The local GGItem to be compared</param>
 /// <param name="theEvent">The Google event to be compared</param>
 private void SolveConflict(List<GGItem> addToLocal, List<GGItem> removeFromLocal, CalendarService GGService, CalendarEntry GGCalendar, GGItem ggItem, AtomEntry theEvent)
 {
     if (theEvent.Updated.CompareTo(ggItem.GetLastModifiedTime()) < 0)
     {   // Local is the latest version : delete on server, then add the latest one
         Log("Local is the latest");
         theEvent.Delete();
         Log("Delete on server");
         ggItem.SetEventAbsoluteUrl(AddGGEvent(GGService, GGCalendar, ggItem));
         Log("Add to server: " + ggItem.ToString());
     }
     else
     {   // Server is the latest version : delete on local, then add the latest one
         Log("Server is the latest");
         EventEntry e = (EventEntry)theEvent;
         GGItem newGGItem = new GGItem(e.Title.Text, e.Times[0].EndTime, ExtractTagFromContents(e.Content.Content), DateTime.Parse(e.Updated.ToLongTimeString()), e.Id.AbsoluteUri, ExtractPathFromContents(e.Content.Content));
         removeFromLocal.Add(ggItem);
         addToLocal.Add(newGGItem);
         Log("Update to lsocal: " + newGGItem.ToString());
     }
 }
示例#3
0
 /** Delete the specified blog entry. */
 static void DeleteEntry(AtomEntry toDelete)
 {
     Console.WriteLine("\nDeleting post");
     // Delete the edited entry
     if (toDelete != null)
     {
         Console.WriteLine("  Press enter to delete the new blog post");
         Console.ReadLine();
         toDelete.Delete();
     }
 }