Esempio n. 1
0
 private void DeleteOnlyInstance()
 {
     if (calendar.DeleteEvent(selectedEvent, GoogleCalendar.ActionType.single))
     {
         messanger.Delete("Deleted", false);
     }
     else
     {
         messanger.Error("Failed to delete single event", false);
     }
     CloseWindow();
 }
Esempio n. 2
0
 private void RemoveTemplate()
 {
     Tempaltes.Remove(SelectedTemplate);
     messanger.Delete("Removed", false);
     SelectedTemplate = Tempaltes.Count > 0 ? Tempaltes[0] : string.Empty;
     SaveChanges();
 }
Esempio n. 3
0
 private void DeleteSound()
 {
     // Check that sound is not in use
     if (SelectedSound == soundPreferences.Success)
     {
         messanger.Error("Cannot delete sound file as it is used for Success sound", true);
     }
     else if (SelectedSound == soundPreferences.Neutral)
     {
         messanger.Error("Cannot delete sound file as it is used for Neutral sound", true);
     }
     else if (SelectedSound == soundPreferences.Error)
     {
         messanger.Error("Cannot delete sound file as it is used for Error sound", true);
     }
     else if (SelectedSound == soundPreferences.Delete)
     {
         messanger.Error("Cannot delete sound file as it is used for Delete sound", true);
     }
     else
     {
         // Delete sound
         soundPreferences.Sounds.Remove(SelectedSound);
         soundPreferences.Save();
         if (File.Exists(appdata + SelectedSound))
         {
             File.Delete(appdata + SelectedSound);
         }
         SoundsList.Remove(SelectedSound);
         SelectedSound = SoundsList.Count > 0 ? SoundsList[0] : string.Empty;
         messanger.Delete("Deleted", false);
     }
 }
Esempio n. 4
0
 private void DeleteEvent()
 {
     if (!SelectedEvent.IsFake)
     {
         if (SelectedEvent.IsRecurrenceEvent)
         {
             repository.SetCurrentEvent(SelectedEvent);
             var deleteEventWindow = new Views.DeleteEventOptionsView();
             deleteEventWindow.ShowDialog();
         }
         else
         {
             if (calendar.DeleteEvent(SelectedEvent, GoogleCalendar.ActionType.single))
             {
                 messanger.Delete("Deleted", false);
             }
             else
             {
                 messanger.Error("Failed to delete event. Please check log file for a detailed information about the error.", false);
             }
         }
         RefreshEventsList();
     }
 }