示例#1
0
        /// <summary>
        /// Init task service.
        /// </summary>
        /// <param name="token">Task service token.</param>
        /// <param name="listTypeIds">Task list name and id dictionary.</param>
        /// <param name="taskServiceType">The task service type.</param>
        /// <returns>Task service itself.</returns>
        public ITaskService InitTaskService(string token, Dictionary <string, string> listTypeIds, ServiceProviderTypes.ProviderTypes taskServiceType)
        {
            ITaskService taskService;

            if (taskServiceType == ServiceProviderTypes.ProviderTypes.OneNote)
            {
                var oneNoteService = new OneNoteService();
                taskService = oneNoteService.InitAsync(token, listTypeIds).Result;
            }
            else
            {
                var outlookService = new OutlookService();
                taskService = outlookService.InitAsync(token, listTypeIds).Result;
            }

            return(taskService);
        }