/// <summary>
        ///     Handles the Click event of the loadButton control.
        ///     Message Dialog retrieved from
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Windows.UI.Xaml.RoutedEventArgs" /> instance containing the event data.</param>
        private async void loadButton_Click(object sender, RoutedEventArgs e)
        {
            this.skipAll                 = false;
            this.entriesToReplace        = new List <FitbitEntry>();
            this.duplicatedDatesNotToAdd = new List <DateTime>();

            var file = await pickFile();

            if (!this.fitbitJournal.IsEmpty())
            {
                var loadDialog = new OnLoadDialog();
                await loadDialog.ShowAsync();

                this.mergeAll   = loadDialog.MergeAll;
                this.replaceAll = loadDialog.Replace;
                if (loadDialog.Cancel)
                {
                    return;
                }
                if (this.replaceAll)
                {
                    this.clearButton_Click(sender, e);
                }
            }
            await this.parseFile(file);

            this.replaceEntries();

            await this.generateHistogram();
        }
Exemplo n.º 2
0
        private async Task <bool> handleEmptyFitbitJournal(object sender, RoutedEventArgs e)
        {
            var loadDialog = new OnLoadDialog();
            await loadDialog.ShowAsync();

            this.mergeAll   = loadDialog.MergeAll;
            this.replaceAll = loadDialog.Replace;
            if (loadDialog.Cancel)
            {
                return(true);
            }

            if (this.replaceAll)
            {
                this.clearButton_Click(sender, e);
            }

            return(false);
        }