Ejemplo n.º 1
0
 // Correct for daylight savings time
 private async void MenuItemDaylightSavingsTimeCorrection_Click(object sender, RoutedEventArgs e)
 {
     // Warn the user that they are currently in a selection displaying only a subset of files, and make sure they want to continue.
     if (Dialogs.MaybePromptToApplyOperationOnSelectionDialog(
             this,
             this.DataHandler.FileDatabase,
             this.State.SuppressSelectedDaylightSavingsCorrectionPrompt,
             "'Correct for daylight savings time...'",
             (bool optOut) => { this.State.SuppressSelectedDaylightSavingsCorrectionPrompt = optOut; }
             ))
     {
         DateDaylightSavingsTimeCorrection dateTimeChange = new DateDaylightSavingsTimeCorrection(this, this.DataHandler.FileDatabase, this.DataHandler.ImageCache);
         if (this.ShowDialogAndCheckIfChangesWereMade(dateTimeChange))
         {
             await this.FilesSelectAndShowAsync().ConfigureAwait(true);
         }
         ;
     }
 }
        /// <summary>Correct for daylight savings time</summary>
        private async void MenuEditDaylightSavingsTimeCorrection_Click(object sender, RoutedEventArgs e)
        {
            if (this.dataHandler.ImageCache.Current.IsDisplayable() == false)
            {
                // Just a corrupted image
                MessageBox messageBox = new MessageBox("Can't correct for daylight savings time.", this);
                messageBox.Message.Problem = "This is a corrupted file.";
                messageBox.Message.Solution = "To correct for daylight savings time, you need to:" + Environment.NewLine;
                messageBox.Message.Solution += "\u2022 be displaying a file with a valid date ";
                messageBox.Message.Solution += "\u2022 where that file should be the one at the daylight savings time threshold.";
                messageBox.ShowDialog();
                return;
            }

            DateDaylightSavingsTimeCorrection daylightSavingsCorrection = new DateDaylightSavingsTimeCorrection(this.dataHandler.FileDatabase, this.dataHandler.ImageCache, this);
            await this.ShowBulkFileEditDialogAsync(daylightSavingsCorrection);
        }