private async Task GetOutlookProfileListInternal()
        {
            OutlookProfileList = await OutlookTaskService.GetOutLookProfieListAsync();

            if (OutlookProfileList == null)
            {
                MessageService.ShowMessageAsync("Failed to fetch outlook profiles. Please try again.");
            }
        }
        private async Task CleanOutlookCalendarInternal()
        {
            if ((SelectedProfile.OutlookSettings.OutlookOptions.HasFlag(OutlookOptionsEnum.AlternateMailBoxCalendar) &&
                 (SelectedProfile.OutlookSettings.OutlookMailBox == null ||
                  SelectedProfile.OutlookSettings.OutlookFolder == null)) ||
                (SelectedProfile.OutlookSettings.OutlookOptions.HasFlag(OutlookOptionsEnum.AlternateProfile) &&
                 string.IsNullOrEmpty(SelectedProfile.OutlookSettings.OutlookProfileName)))
            {
                MessageService.ShowMessageAsync("Please select a Outlook calendar to reset.");
                return;
            }

            var task =
                await
                MessageService.ShowConfirmMessage(
                    "Are you sure you want to reset events from 10 year past and 10 year future?");

            if (task != MessageDialogResult.Affirmative)
            {
                return;
            }

            var calendarSpecificData = new Dictionary <string, object>
            {
                {
                    "ProfileName",
                    SelectedProfile.OutlookSettings.OutlookOptions.HasFlag(OutlookOptionsEnum.AlternateProfile)
                        ? SelectedProfile.OutlookSettings.OutlookProfileName
                        : null
                },
                {
                    "OutlookTaskList",
                    SelectedProfile.OutlookSettings.OutlookOptions.HasFlag(OutlookOptionsEnum.AlternateMailBoxCalendar)
                        ? SelectedProfile.OutlookSettings.OutlookFolder
                        : null
                }
            };

            var result = await OutlookTaskService.ClearCalendar(calendarSpecificData);

            if (!result)
            {
                MessageService.ShowMessageAsync("Reset calendar failed.");
            }
        }
 private List <OutlookMailBox> GetOutlookMailBox()
 {
     return(OutlookTaskService.GetAllMailBoxes(SelectedProfile.OutlookSettings.OutlookProfileName ?? string.Empty));
 }